Spaces:
Runtime error
Runtime error
| 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() | |