Display the final image before running postprocessing, and don't preview when i=0

This commit is contained in:
Chris Heald 2022-09-16 18:25:08 -07:00
parent d53643822d
commit 27c8134547

View File

@ -796,7 +796,7 @@ def generation_callback(img, i=0):
except TypeError:
pass
if i % int(st.session_state.update_preview_frequency) == 0 and st.session_state.update_preview:
if i % int(st.session_state.update_preview_frequency) == 0 and st.session_state.update_preview and i > 0:
#print (img)
#print (type(img))
# The following lines will convert the tensor we got on img to an actual image we can render on the UI.
@ -1437,6 +1437,8 @@ def process_images(
original_sample = x_sample
original_filename = filename
st.session_state["preview_image"].image(image)
if use_GFPGAN and st.session_state["GFPGAN"] is not None and not use_RealESRGAN:
st.session_state["progress_bar_text"].text("Running GFPGAN on image %d of %d..." % (i+1, len(x_samples_ddim)))
#skip_save = True # #287 >_>