Download app.py from dejinlee/art: direct link, hf CLI and curl.
- Browser
- Download file 336 Bytes
-
https://huggingface.co/spaces/dejinlee/art/resolve/main/app.py
- Command line
-
hf download hf://spaces/dejinlee/art/app.py
-
curl -L -o app.py https://huggingface.co/spaces/dejinlee/art/resolve/main/app.py
336 Bytes
| import gradio as gr | |
| from diffusers import StableDiffusionPipeline | |
| def draw(text): | |
| pipe = StableDiffusionPipeline.from_pretrained("IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-EN-v0.1") | |
| image = pipe(text, guidance_scale=10).images[0] | |
| return image | |
| iface = gr.Interface(fn=draw, inputs="text", outputs="image") | |
| iface.launch() |