Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from diffusers import DDPMPipeline
|
| 3 |
import PIL
|
|
|
|
| 4 |
|
| 5 |
def generate_image():
|
| 6 |
pipeline = DDPMPipeline.from_pretrained('dvoils/sd-class-butterflies-32')
|
|
@@ -10,5 +11,14 @@ def generate_image():
|
|
| 10 |
st.title('DDPMPipeline Image Generator')
|
| 11 |
|
| 12 |
if st.button('Generate Image'):
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from diffusers import DDPMPipeline
|
| 3 |
import PIL
|
| 4 |
+
import time
|
| 5 |
|
| 6 |
def generate_image():
|
| 7 |
pipeline = DDPMPipeline.from_pretrained('dvoils/sd-class-butterflies-32')
|
|
|
|
| 11 |
st.title('DDPMPipeline Image Generator')
|
| 12 |
|
| 13 |
if st.button('Generate Image'):
|
| 14 |
+
with st.spinner('Generating Image...'):
|
| 15 |
+
# Create a progress bar
|
| 16 |
+
progress_bar = st.progress(0)
|
| 17 |
+
|
| 18 |
+
for i in range(100):
|
| 19 |
+
# Update the progress bar with each iteration.
|
| 20 |
+
time.sleep(0.01)
|
| 21 |
+
progress_bar.progress(i + 1)
|
| 22 |
+
|
| 23 |
+
image = generate_image()
|
| 24 |
+
st.image(image, caption='Generated Image', use_column_width=True)
|