File size: 463 Bytes
015d334
 
 
 
f835fe5
 
 
015d334
f835fe5
 
 
 
015d334
f835fe5
 
015d334
f835fe5
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from diffusers import DiffusionPipeline
import torch

# Load DeepFloyd IF Model
pipe = DiffusionPipeline.from_pretrained("DeepFloyd/IF-I-XL-v1.0", torch_dtype=torch.float16)
pipe.to("cuda")

# Function to generate an image
def generate_image(prompt):
    image = pipe(prompt).images[0]
    return image

# Gradio UI
demo = gr.Interface(fn=generate_image, inputs="text", outputs="image", title="AI Image Generator")

# Launch App
demo.launch()