Spaces:
Build error
Build error
Download app.py from dvoils/simple-diffusion: direct link, hf CLI and curl.
- Browser
- Download file 572 Bytes
-
https://huggingface.co/spaces/dvoils/simple-diffusion/resolve/main/app.py
- Command line
-
hf download hf://spaces/dvoils/simple-diffusion/app.py
-
curl -L -o app.py https://huggingface.co/spaces/dvoils/simple-diffusion/resolve/main/app.py
572 Bytes
| import streamlit as st | |
| from diffusers import DDPMPipeline | |
| import PIL | |
| # Use the cache decorator to only re-run when the inputs change | |
| # @st.cache(suppress_st_warning=True, allow_output_mutation=True) | |
| def generate_image(): | |
| pipeline = DDPMPipeline.from_pretrained('dvoils/sd-class-butterflies-32') | |
| image = pipeline().images[0] | |
| return image | |
| st.title('DDPMPipeline Image Generator') | |
| if st.button('Generate Image'): | |
| with st.spinner('Generating Image...'): | |
| image = generate_image() | |
| st.image(image, caption='Generated Image', use_column_width=True) | |