Download app.py from Agradeep/imagixpro: direct link, hf CLI and curl.
- Browser
- Download file 522 Bytes
-
https://huggingface.co/spaces/Agradeep/imagixpro/resolve/main/app.py
- Command line
-
hf download hf://spaces/Agradeep/imagixpro/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Agradeep/imagixpro/resolve/main/app.py
522 Bytes
| import gradio as gr | |
| from diffusers import StableDiffusionPipeline | |
| import torch | |
| model_id = "runwayml/stable-diffusion-v1-5" | |
| pipe = StableDiffusionPipeline.from_pretrained( | |
| model_id, | |
| torch_dtype=torch.float32 | |
| ) | |
| pipe = pipe.to("cpu") | |
| def generate(prompt): | |
| image = pipe(prompt).images[0] | |
| return image | |
| app = gr.Interface( | |
| fn=generate, | |
| inputs=gr.Textbox(label="Prompt"), | |
| outputs=gr.Image(label="Generated Image"), | |
| title="Imagix AI", | |
| description="Free AI Image Generator" | |
| ) | |
| app.launch() |