Spaces:
Runtime error
Runtime error
Download app.py from AyushDey/Image_Generator: direct link, hf CLI and curl.
- Browser
- Download file 576 Bytes
-
https://huggingface.co/spaces/AyushDey/Image_Generator/resolve/main/app.py
- Command line
-
hf download hf://spaces/AyushDey/Image_Generator/app.py
-
curl -L -o app.py https://huggingface.co/spaces/AyushDey/Image_Generator/resolve/main/app.py
576 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| from diffusers import DiffusionPipeline | |
| pipe = DiffusionPipeline.from_pretrained('stabilityai/stable-diffusion-xl-base-1.0') | |
| def imagen(prompt): | |
| return pipe(prompt).images[0] | |
| a = gr.Interface(fn=imagen, inputs=[gr.Textbox(label="Enter prompt for an image")], | |
| outputs=[gr.Image(label='Generated Image')], | |
| title='Image Generation Using Stable Diffusion', | |
| examples=["the spirit of a tamagotchi wandering in the city of Vienna","a mecha robot in a favela"]) | |
| a.launch() |