Spaces:
Paused
Paused
Download app.py from Nymbo/text-to-image: direct link, hf CLI and curl.
- Browser
- Download file 533 Bytes
-
https://huggingface.co/spaces/Nymbo/text-to-image/resolve/main/app.py
- Command line
-
hf download hf://spaces/Nymbo/text-to-image/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Nymbo/text-to-image/resolve/main/app.py
533 Bytes
| import gradio as gr | |
| from text_to_image import TextToImageTool | |
| tool = TextToImageTool() | |
| tool.setup() | |
| def image_generator(prompt): | |
| if not prompt or not prompt.strip(): | |
| raise gr.Error("Please enter a prompt.") | |
| return tool(prompt) | |
| gr.Interface( | |
| fn=image_generator, | |
| inputs=gr.Textbox(label="prompt", info="the image description"), | |
| outputs=gr.Image(label="Output"), | |
| title="Text to Image", | |
| description=tool.description, | |
| api_name="image_generator", | |
| ).queue(default_concurrency_limit=1).launch() | |