ImageGEN / app.py
Atharwaaah's picture
Create app.py
f835fe5 verified
raw
history blame
463 Bytes
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()