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,7 +157,9 @@ def layout():
#in steps will be shown, this is helpful to reduce the negative effect this option has on performance. \ #in steps will be shown, this is helpful to reduce the negative effect this option has on performance. \
#Default: True") #Default: True")
st.session_state["defaults"].general.update_preview = 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, 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 \ 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") negative effect updating the preview image has on performance. Default: 10")
@ -326,6 +328,7 @@ def layout():
st.session_state["defaults"].txt2img.update_preview = True st.session_state["defaults"].txt2img.update_preview = True
st.session_state["defaults"].txt2img.update_preview_frequency = st.number_input("Preview Image Update Frequency", st.session_state["defaults"].txt2img.update_preview_frequency = st.number_input("Preview Image Update Frequency",
min_value=1,
value=st.session_state['defaults'].txt2img.update_preview_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") help="Set the default value for the frrquency of the preview image updates. Default is: 10")
@ -526,6 +529,7 @@ def layout():
st.session_state["defaults"].img2img.update_preview = True st.session_state["defaults"].img2img.update_preview = True
st.session_state["defaults"].img2img.update_preview_frequency = st.number_input("Img2Img Preview Image Update Frequency", st.session_state["defaults"].img2img.update_preview_frequency = st.number_input("Img2Img Preview Image Update Frequency",
min_value=1,
value=st.session_state['defaults'].img2img.update_preview_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") help="Set the default value for the frrquency of the preview image updates. Default is: 10")

View File

@ -446,7 +446,9 @@ def layout():
with st.expander("Preview Settings"): with st.expander("Preview Settings"):
st.session_state["update_preview"] = st.session_state["defaults"].general.update_preview 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, 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 \ help="Frequency in steps at which the the preview image is updated. By default the frequency \
is set to 1 step.") is set to 1 step.")
# #

View File

@ -222,7 +222,9 @@ def layout():
with st.expander("Preview Settings"): with st.expander("Preview Settings"):
st.session_state["update_preview"] = st.session_state["defaults"].general.update_preview 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, 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 \ help="Frequency in steps at which the the preview image is updated. By default the frequency \
is set to 10 step.") is set to 10 step.")

View File

@ -613,7 +613,9 @@ def layout():
#By default this is enabled and the frequency is set to 1 step.") #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"] = 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, 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 \ help="Frequency in steps at which the the preview image is updated. By default the frequency \
is set to 1 step.") is set to 1 step.")