Spaces:
Build error
Build error
Download app.py from claudioDoped/stableVoid: direct link, hf CLI and curl.
- Browser
- Download file 654 Bytes
-
https://huggingface.co/spaces/claudioDoped/stableVoid/resolve/main/app.py
- Command line
-
hf download hf://spaces/claudioDoped/stableVoid/app.py
-
curl -L -o app.py https://huggingface.co/spaces/claudioDoped/stableVoid/resolve/main/app.py
654 Bytes
| from gradio import Interface | |
| from diffusers import StableDiffusionPipeline | |
| # Load the Stable Diffusion model (specific checkpoint for sd-1.5) | |
| pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5") | |
| def generate(prompt, num_iterations=20): | |
| """Generates an image based on the provided prompt.""" | |
| images = pipe(prompt, num_iterations=num_iterations).images | |
| return images[0] | |
| # Gradio interface with basic controls | |
| interface = Interface( | |
| fn=generate, | |
| inputs="text", | |
| outputs="image", | |
| title="Stable Diffusion (sd-1.5)", | |
| description="Create images with text prompts using Stable Diffusion v1.5." | |
| ) | |
| interface.launch() | |