Download app.py from fathercan/README: direct link, hf CLI and curl.
- Browser
- Download file 345 Bytes
-
https://huggingface.co/spaces/fathercan/README/resolve/main/app.py
- Command line
-
hf download hf://spaces/fathercan/README/app.py
-
curl -L -o app.py https://huggingface.co/spaces/fathercan/README/resolve/main/app.py
345 Bytes
| from diffusers import StableDiffusionPipeline | |
| import gradio as gr | |
| pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4").to("cuda") | |
| def generate(prompt): | |
| image = pipe(prompt).images[0] | |
| return image | |
| demo = gr.Interface(fn=generate, inputs="text", outputs="image") | |
| if __name__ == "__main__": | |
| demo.launch() | |