Added option to set default sampler name from config file, will be useful for those wanting to change the default sampler and have it persist even when closing the UI and opening it again.

This commit is contained in:
ZeroCool940711 2022-09-07 16:58:19 -07:00
parent a81671d673
commit 1d4351ce91
2 changed files with 5 additions and 3 deletions

View File

@ -37,6 +37,7 @@ txt2img:
batch_count: 1
batch_size: 1
sampling_steps: 50
default_sampler: "k_lms"
separate_prompts: False
normalize_prompt_weights: True
save_individual_images: True

View File

@ -1556,9 +1556,10 @@ def layout():
with col3:
st.session_state.sampling_steps = st.slider("Sampling Steps", value=defaults.txt2img.sampling_steps, min_value=1, max_value=250)
sampler_name = st.selectbox("Sampling method",
["k_lms", "k_euler", "k_euler_a", "k_dpm_2", "k_dpm_2_a", "k_heun", "PLMS", "DDIM"],
index=0, help="Sampling method to use. Default: k_lms")
sampler_name_list = ["k_lms", "k_euler", "k_euler_a", "k_dpm_2", "k_dpm_2_a", "k_heun", "PLMS", "DDIM"]
sampler_name = st.selectbox("Sampling method", sampler_name_list,
index=sampler_name_list.index(defaults.txt2img.default_sampler), help="Sampling method to use. Default: k_euler")