Spaces:
Runtime error
Runtime error
Download app.py from 123LETSPLAY/texttoimage1234321: direct link, hf CLI and curl.
- Browser
- Download file 626 Bytes
-
https://huggingface.co/spaces/123LETSPLAY/texttoimage1234321/resolve/main/app.py
- Command line
-
hf download hf://spaces/123LETSPLAY/texttoimage1234321/app.py
-
curl -L -o app.py https://huggingface.co/spaces/123LETSPLAY/texttoimage1234321/resolve/main/app.py
626 Bytes
| import gradio as gr | |
| from diffusers import DiffusionPipeline | |
| # Load the diffusion pipeline | |
| pipe = DiffusionPipeline.from_pretrained("ostris/OpenFLUX.1") | |
| def generate_image(prompt): | |
| image = pipe(prompt).images[0] | |
| return image | |
| # Set up the Gradio interface | |
| iface = gr.Interface( | |
| fn=generate_image, | |
| inputs=gr.Textbox(label="Prompt", placeholder="Enter a prompt..."), | |
| outputs=gr.Image(label="Generated Image"), | |
| title="Diffusion Model Image Generator", | |
| description="Generate images using a diffusion model based on your text prompts." | |
| ) | |
| # Launch the app | |
| if __name__ == "__main__": | |
| iface.launch() | |