Changed CFG scale to be a number_input instead of a slider.

This commit is contained in:
ZeroCool940711 2022-10-17 18:01:19 -07:00
parent 27c13fb625
commit 774073c8c3
5 changed files with 599 additions and 617 deletions

View File

@ -38,6 +38,7 @@ general:
upscaling_method: "RealESRGAN" upscaling_method: "RealESRGAN"
outdir_txt2img: outputs/txt2img outdir_txt2img: outputs/txt2img
outdir_img2img: outputs/img2img outdir_img2img: outputs/img2img
outdir_img2txt: outputs/img2txt
gfpgan_cpu: False gfpgan_cpu: False
esrgan_cpu: False esrgan_cpu: False
extra_models_cpu: False extra_models_cpu: False
@ -83,7 +84,6 @@ txt2img:
cfg_scale: cfg_scale:
value: 7.5 value: 7.5
min_value: 1.0 min_value: 1.0
max_value: 30.0
step: 0.5 step: 0.5
seed: "" seed: ""
@ -148,7 +148,6 @@ txt2vid:
cfg_scale: cfg_scale:
value: 7.5 value: 7.5
min_value: 1.0 min_value: 1.0
max_value: 30.0
step: 0.5 step: 0.5
batch_count: batch_count:
@ -253,8 +252,7 @@ img2img:
cfg_scale: cfg_scale:
value: 7.5 value: 7.5
min_value: 1.0 min_value: 1.0
max_value: 30.0
step: 0.5 step: 0.5
batch_count: batch_count:
@ -277,9 +275,8 @@ img2img:
find_noise_steps: find_noise_steps:
value: 100 value: 100
min_value: 0 min_value: 100
max_value: 500 step: 100
step: 10
LDSR_config: LDSR_config:
sampling_steps: 50 sampling_steps: 50

File diff suppressed because it is too large Load Diff

View File

@ -405,23 +405,23 @@ def layout():
value=st.session_state['defaults'].img2img.height.value, step=st.session_state['defaults'].img2img.height.step) value=st.session_state['defaults'].img2img.height.value, step=st.session_state['defaults'].img2img.height.step)
seed = st.text_input("Seed:", value=st.session_state['defaults'].img2img.seed, help=" The seed to use, if left blank a random seed will be generated.") seed = st.text_input("Seed:", value=st.session_state['defaults'].img2img.seed, help=" The seed to use, if left blank a random seed will be generated.")
cfg_scale = st.slider("CFG (Classifier Free Guidance Scale):", min_value=st.session_state['defaults'].img2img.cfg_scale.min_value, cfg_scale = st.number_input("CFG (Classifier Free Guidance Scale):", min_value=st.session_state['defaults'].img2img.cfg_scale.min_value,
max_value=st.session_state['defaults'].img2img.cfg_scale.max_value, value=st.session_state['defaults'].img2img.cfg_scale.value, step=st.session_state['defaults'].img2img.cfg_scale.step,
step=st.session_state['defaults'].img2img.cfg_scale.step, help="How strongly the image should follow the prompt.") help="How strongly the image should follow the prompt.")
st.session_state["denoising_strength"] = st.slider("Denoising Strength:", value=st.session_state['defaults'].img2img.denoising_strength.value, st.session_state["denoising_strength"] = st.slider("Denoising Strength:", value=st.session_state['defaults'].img2img.denoising_strength.value,
min_value=st.session_state['defaults'].img2img.denoising_strength.min_value, min_value=st.session_state['defaults'].img2img.denoising_strength.min_value,
max_value=st.session_state['defaults'].img2img.denoising_strength.max_value, max_value=st.session_state['defaults'].img2img.denoising_strength.max_value,
step=st.session_state['defaults'].img2img.denoising_strength.step) step=st.session_state['defaults'].img2img.denoising_strength.step)
mask_expander = st.empty() mask_expander = st.empty()
with mask_expander.expander("Mask"): with mask_expander.expander("Mask"):
mask_mode_list = ["Mask", "Inverted mask", "Image alpha"] mask_mode_list = ["Mask", "Inverted mask", "Image alpha"]
mask_mode = st.selectbox("Mask Mode", mask_mode_list, mask_mode = st.selectbox("Mask Mode", mask_mode_list,
help="Select how you want your image to be masked.\"Mask\" modifies the image where the mask is white.\n\ help="Select how you want your image to be masked.\"Mask\" modifies the image where the mask is white.\n\
\"Inverted mask\" modifies the image where the mask is black. \"Image alpha\" modifies the image where the image is transparent." \"Inverted mask\" modifies the image where the mask is black. \"Image alpha\" modifies the image where the image is transparent."
) )
mask_mode = mask_mode_list.index(mask_mode) mask_mode = mask_mode_list.index(mask_mode)
@ -431,26 +431,26 @@ def layout():
help="" help=""
) )
noise_mode = noise_mode_list.index(noise_mode) noise_mode = noise_mode_list.index(noise_mode)
find_noise_steps = st.slider("Find Noise Steps", value=st.session_state['defaults'].img2img.find_noise_steps.value, find_noise_steps = st.number_input("Find Noise Steps", value=st.session_state['defaults'].img2img.find_noise_steps.value,
min_value=st.session_state['defaults'].img2img.find_noise_steps.min_value, max_value=st.session_state['defaults'].img2img.find_noise_steps.max_value, min_value=st.session_state['defaults'].img2img.find_noise_steps.min_value,
step=st.session_state['defaults'].img2img.find_noise_steps.step) step=st.session_state['defaults'].img2img.find_noise_steps.step)
with st.expander("Batch Options"): with st.expander("Batch Options"):
st.session_state["batch_count"] = st.number_input("Batch count.", value=st.session_state['defaults'].img2img.batch_count.value, st.session_state["batch_count"] = st.number_input("Batch count.", value=st.session_state['defaults'].img2img.batch_count.value,
help="How many iterations or batches of images to generate in total.") help="How many iterations or batches of images to generate in total.")
st.session_state["batch_size"] = st.number_input("Batch size", value=st.session_state.defaults.img2img.batch_size.value, st.session_state["batch_size"] = st.number_input("Batch size", value=st.session_state.defaults.img2img.batch_size.value,
help="How many images are at once in a batch.\ help="How many images are at once in a batch.\
It increases the VRAM usage a lot but if you have enough VRAM it can reduce the time it takes to finish generation as more images are generated at once.\ It increases the VRAM usage a lot but if you have enough VRAM it can reduce the time it takes to finish generation as more images are generated at once.\
Default: 1") Default: 1")
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=1,
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.")
# #
with st.expander("Advanced"): with st.expander("Advanced"):
with st.expander("Output Settings"): with st.expander("Output Settings"):

View File

@ -412,10 +412,10 @@ def layout():
value=st.session_state['defaults'].txt2img.width.value, step=st.session_state['defaults'].txt2img.width.step) value=st.session_state['defaults'].txt2img.width.value, step=st.session_state['defaults'].txt2img.width.step)
height = st.slider("Height:", min_value=st.session_state['defaults'].txt2img.height.min_value, max_value=st.session_state['defaults'].txt2img.height.max_value, height = st.slider("Height:", min_value=st.session_state['defaults'].txt2img.height.min_value, max_value=st.session_state['defaults'].txt2img.height.max_value,
value=st.session_state['defaults'].txt2img.height.value, step=st.session_state['defaults'].txt2img.height.step) value=st.session_state['defaults'].txt2img.height.value, step=st.session_state['defaults'].txt2img.height.step)
cfg_scale = st.slider("CFG (Classifier Free Guidance Scale):", min_value=st.session_state['defaults'].txt2img.cfg_scale.min_value, cfg_scale = st.number_input("CFG (Classifier Free Guidance Scale):", min_value=st.session_state['defaults'].txt2img.cfg_scale.min_value,
max_value=st.session_state['defaults'].txt2img.cfg_scale.max_value,
value=st.session_state['defaults'].txt2img.cfg_scale.value, step=st.session_state['defaults'].txt2img.cfg_scale.step, value=st.session_state['defaults'].txt2img.cfg_scale.value, step=st.session_state['defaults'].txt2img.cfg_scale.step,
help="How strongly the image should follow the prompt.") help="How strongly the image should follow the prompt.")
seed = st.text_input("Seed:", value=st.session_state['defaults'].txt2img.seed, help=" The seed to use, if left blank a random seed will be generated.") seed = st.text_input("Seed:", value=st.session_state['defaults'].txt2img.seed, help=" The seed to use, if left blank a random seed will be generated.")
with st.expander("Batch Options"): with st.expander("Batch Options"):

View File

@ -651,9 +651,10 @@ def layout():
value=st.session_state['defaults'].txt2vid.width.value, step=st.session_state['defaults'].txt2vid.width.step) value=st.session_state['defaults'].txt2vid.width.value, step=st.session_state['defaults'].txt2vid.width.step)
height = st.slider("Height:", min_value=st.session_state['defaults'].txt2vid.height.min_value, max_value=st.session_state['defaults'].txt2vid.height.max_value, height = st.slider("Height:", min_value=st.session_state['defaults'].txt2vid.height.min_value, max_value=st.session_state['defaults'].txt2vid.height.max_value,
value=st.session_state['defaults'].txt2vid.height.value, step=st.session_state['defaults'].txt2vid.height.step) value=st.session_state['defaults'].txt2vid.height.value, step=st.session_state['defaults'].txt2vid.height.step)
cfg_scale = st.slider("CFG (Classifier Free Guidance Scale):", min_value=st.session_state['defaults'].txt2vid.cfg_scale.min_value, cfg_scale = st.number_input("CFG (Classifier Free Guidance Scale):", min_value=st.session_state['defaults'].txt2vid.cfg_scale.min_value,
max_value=st.session_state['defaults'].txt2vid.cfg_scale.max_value, value=st.session_state['defaults'].txt2vid.cfg_scale.value, value=st.session_state['defaults'].txt2vid.cfg_scale.value,
step=st.session_state['defaults'].txt2vid.cfg_scale.step, help="How strongly the image should follow the prompt.") step=st.session_state['defaults'].txt2vid.cfg_scale.step,
help="How strongly the image should follow the prompt.")
#uploaded_images = st.file_uploader("Upload Image", accept_multiple_files=False, type=["png", "jpg", "jpeg", "webp"], #uploaded_images = st.file_uploader("Upload Image", accept_multiple_files=False, type=["png", "jpg", "jpeg", "webp"],
#help="Upload an image which will be used for the image to image generation.") #help="Upload an image which will be used for the image to image generation.")