Spaces:
Runtime error
Runtime error
undo the central generate edit
Browse files
app.py
CHANGED
@@ -68,17 +68,15 @@ def main():
|
|
68 |
with col2:
|
69 |
factor_slider = st.slider('Choose Upscaling Factor:', min_value=1.0, max_value=10.0, value=1.0, step=0.5, format="")
|
70 |
st.write(f"Selected Upscaling Factor: {factor_slider}")
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
except Exception as e:
|
81 |
-
st.error(f"An error occurred during image upscaling: {e}")
|
82 |
|
83 |
|
84 |
if __name__ == "__main__":
|
|
|
68 |
with col2:
|
69 |
factor_slider = st.slider('Choose Upscaling Factor:', min_value=1.0, max_value=10.0, value=1.0, step=0.5, format="")
|
70 |
st.write(f"Selected Upscaling Factor: {factor_slider}")
|
71 |
+
if st.button("Generate"):
|
72 |
+
factor = st.session_state.user_factor if st.session_state.user_factor is not None else factor_slider
|
73 |
+
with st.spinner('Generating images...'):
|
74 |
+
result_image_stream = asyncio.run(async_upscaler(Image_stream, factor))
|
75 |
+
try:
|
76 |
+
print(type(result_image_stream))
|
77 |
+
st.image(result_image_stream.getvalue())
|
78 |
+
except Exception as e:
|
79 |
+
st.error(f"An error occurred during image upscaling: {e}")
|
|
|
|
|
80 |
|
81 |
|
82 |
if __name__ == "__main__":
|