Spaces:
Runtime error
Runtime error
Download app.py from Atharwaaah/ImageGEN: direct link, hf CLI and curl.
- Browser
- Download file 463 Bytes
-
https://huggingface.co/spaces/Atharwaaah/ImageGEN/resolve/main/app.py
- Command line
-
hf download hf://spaces/Atharwaaah/ImageGEN/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Atharwaaah/ImageGEN/resolve/main/app.py
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() | |