Spaces:
Sleeping
Sleeping
Download app.py from holmbergfan/Model001: direct link, hf CLI and curl.
- Browser
- Download file 565 Bytes
-
https://huggingface.co/spaces/holmbergfan/Model001/resolve/main/app.py
- Command line
-
hf download hf://spaces/holmbergfan/Model001/app.py
-
curl -L -o app.py https://huggingface.co/spaces/holmbergfan/Model001/resolve/main/app.py
565 Bytes
| import streamlit as st | |
| from diffusers import DiffusionPipeline | |
| # Load the diffusion model | |
| pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev") | |
| # Streamlit UI | |
| st.title("Personal Image Generator") | |
| # Input prompt for generating images | |
| prompt = st.text_input("Enter your prompt", "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k") | |
| # Generate the image on button click | |
| if st.button("Generate Image"): | |
| with st.spinner("Generating image..."): | |
| image = pipe(prompt).images[0] | |
| st.image(image, caption=prompt) | |