Spaces:
Build error
Build error
| 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) | |