Spaces:
Runtime error
Runtime error
Download app.py from chiba39net/README: direct link, hf CLI and curl.
- Browser
- Download file 440 Bytes
-
https://huggingface.co/spaces/chiba39net/README/resolve/main/app.py
- Command line
-
hf download hf://spaces/chiba39net/README/app.py
-
curl -L -o app.py https://huggingface.co/spaces/chiba39net/README/resolve/main/app.py
440 Bytes
| import gradio as gr | |
| import torch | |
| from diffusers import StableDiffusionPipeline | |
| pipe = StableDiffusionPipeline.from_pretrained( | |
| "dreamlike-art/dreamlike-photoreal-2.0", | |
| force_download=True | |
| ) | |
| pipe = pipe.to("cpu") | |
| def generate_image(prompt): | |
| image = pipe(prompt, height=256, width=256).images[0] | |
| return image | |
| gr.Interface(fn=generate_image, inputs="text", outputs="image", title="Stable Diffusion Image Generator").launch() | |