Changed the image preview frequency field to only allow positive values. (#1472)

This commit is contained in:
Alejandro Gil 2022-10-07 17:00:33 -07:00 committed by GitHub
commit a67f4230fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 17 deletions

View File

@ -157,9 +157,11 @@ def layout():
#in steps will be shown, this is helpful to reduce the negative effect this option has on performance. \
#Default: True")
st.session_state["defaults"].general.update_preview = True
st.session_state["defaults"].general.update_preview_frequency = st.number_input("Update Preview Frequency", value=st.session_state['defaults'].general.update_preview_frequency,
help="Specify the frequency at which the image is updated in steps, this is helpful to reduce the \
negative effect updating the preview image has on performance. Default: 10")
st.session_state["defaults"].general.update_preview_frequency = st.number_input("Update Preview Frequency",
min_value=1,
value=st.session_state['defaults'].general.update_preview_frequency,
help="Specify the frequency at which the image is updated in steps, this is helpful to reduce the \
negative effect updating the preview image has on performance. Default: 10")
with col3:
st.title("Others")
@ -326,8 +328,9 @@ def layout():
st.session_state["defaults"].txt2img.update_preview = True
st.session_state["defaults"].txt2img.update_preview_frequency = st.number_input("Preview Image Update Frequency",
value=st.session_state['defaults'].txt2img.update_preview_frequency,
help="Set the default value for the frrquency of the preview image updates. Default is: 10")
min_value=1,
value=st.session_state['defaults'].txt2img.update_preview_frequency,
help="Set the default value for the frrquency of the preview image updates. Default is: 10")
with col5:
st.title("Variation Parameters")
@ -526,8 +529,9 @@ def layout():
st.session_state["defaults"].img2img.update_preview = True
st.session_state["defaults"].img2img.update_preview_frequency = st.number_input("Img2Img Preview Image Update Frequency",
value=st.session_state['defaults'].img2img.update_preview_frequency,
help="Set the default value for the frrquency of the preview image updates. Default is: 10")
min_value=1,
value=st.session_state['defaults'].img2img.update_preview_frequency,
help="Set the default value for the frrquency of the preview image updates. Default is: 10")
st.title("Variation Parameters")

View File

@ -446,9 +446,11 @@ def layout():
with st.expander("Preview Settings"):
st.session_state["update_preview"] = st.session_state["defaults"].general.update_preview
st.session_state["update_preview_frequency"] = st.text_input("Update Image Preview Frequency", value=st.session_state['defaults'].img2img.update_preview_frequency,
help="Frequency in steps at which the the preview image is updated. By default the frequency \
is set to 1 step.")
st.session_state["update_preview_frequency"] = st.number_input("Update Image Preview Frequency",
min_value=1,
value=st.session_state['defaults'].img2img.update_preview_frequency,
help="Frequency in steps at which the the preview image is updated. By default the frequency \
is set to 1 step.")
#
with st.expander("Advanced"):
with st.expander("Output Settings"):

View File

@ -222,9 +222,11 @@ def layout():
with st.expander("Preview Settings"):
st.session_state["update_preview"] = st.session_state["defaults"].general.update_preview
st.session_state["update_preview_frequency"] = st.text_input("Update Image Preview Frequency", value=st.session_state['defaults'].txt2img.update_preview_frequency,
help="Frequency in steps at which the the preview image is updated. By default the frequency \
is set to 10 step.")
st.session_state["update_preview_frequency"] = st.number_input("Update Image Preview Frequency",
min_value=1,
value=st.session_state['defaults'].txt2img.update_preview_frequency,
help="Frequency in steps at which the the preview image is updated. By default the frequency \
is set to 10 step.")
with col2:
preview_tab, gallery_tab = st.tabs(["Preview", "Gallery"])

View File

@ -155,7 +155,7 @@ def diffuse(
st.session_state["previous_chunk_speed_list"],
st.session_state['defaults'].txt2vid.update_preview_frequency,
st.session_state["update_preview_frequency_list"])
#scale and decode the image latents with vae
cond_latents_2 = 1 / 0.18215 * cond_latents
image = pipe.vae.decode(cond_latents_2)
@ -613,9 +613,11 @@ def layout():
#By default this is enabled and the frequency is set to 1 step.")
st.session_state["update_preview"] = st.session_state["defaults"].general.update_preview
st.session_state["update_preview_frequency"] = st.text_input("Update Image Preview Frequency", value=st.session_state['defaults'].txt2vid.update_preview_frequency,
help="Frequency in steps at which the the preview image is updated. By default the frequency \
is set to 1 step.")
st.session_state["update_preview_frequency"] = st.number_input("Update Image Preview Frequency",
min_value=1,
value=st.session_state['defaults'].txt2vid.update_preview_frequency,
help="Frequency in steps at which the the preview image is updated. By default the frequency \
is set to 1 step.")
#