Allow users to set the preview frequency to 0 in case they need to disable it.

This commit is contained in:
ZeroCool940711 2022-10-24 12:35:30 -07:00
parent bb7fce1a87
commit ad5597b968
4 changed files with 6 additions and 6 deletions

View File

@ -159,7 +159,7 @@ def layout():
# 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", st.session_state["defaults"].general.update_preview_frequency = st.number_input("Update Preview Frequency",
min_value=1, min_value=0,
value=st.session_state['defaults'].general.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 \ 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")
@ -327,7 +327,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, min_value=0,
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")
@ -520,7 +520,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, min_value=0,
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

@ -455,7 +455,7 @@ 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.number_input("Update Image Preview Frequency", st.session_state["update_preview_frequency"] = st.number_input("Update Image Preview Frequency",
min_value=1, min_value=0,
value=st.session_state['defaults'].img2img.update_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 \ 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

@ -447,7 +447,7 @@ def layout():
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.number_input("Update Image Preview Frequency", st.session_state["update_preview_frequency"] = st.number_input("Update Image Preview Frequency",
min_value=1, min_value=0,
value=st.session_state['defaults'].txt2img.update_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 \ 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

@ -698,7 +698,7 @@ def layout():
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.number_input("Update Image Preview Frequency", st.session_state["update_preview_frequency"] = st.number_input("Update Image Preview Frequency",
min_value=1, min_value=0,
value=st.session_state['defaults'].txt2vid.update_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 \ 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.")