mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
Merge pull request #829 from froger-me/master
[UX] UniPC and PLMS as fallback, PLMS forced, settings consistency
This commit is contained in:
@@ -32,7 +32,11 @@ def set_samplers():
|
||||
global samplers, samplers_for_img2img
|
||||
|
||||
shown_img2img = set(shared.opts.show_samplers)
|
||||
shown = set(shared.opts.show_samplers + ['PLMS', 'UniPC'])
|
||||
|
||||
if len(shared.opts.show_samplers) == 0:
|
||||
shown = {'PLMS', 'UniPC'}
|
||||
else:
|
||||
shown = set(shared.opts.show_samplers + ['PLMS'])
|
||||
|
||||
samplers = [x for x in all_samplers if x.name in shown]
|
||||
samplers_for_img2img = [x for x in all_samplers if x.name in shown_img2img]
|
||||
|
||||
+1
-1
@@ -424,7 +424,7 @@ options_templates.update(options_section(('ui', "Live previews"), {
|
||||
}))
|
||||
|
||||
options_templates.update(options_section(('sampler-params', "Sampler parameters"), {
|
||||
"show_samplers": OptionInfo(["Euler a", "UniPC", "DDIM", "DPM++ SDE", "DPM++ SDE", "DPM2 Karras", "DPM++ 2M Karras"], "Show samplers in user interface", gr.CheckboxGroup, lambda: {"choices": [x.name for x in list_samplers()]}),
|
||||
"show_samplers": OptionInfo(["Euler a", "UniPC", "DDIM", "DPM++ SDE", "DPM++ SDE", "DPM2 Karras", "DPM++ 2M Karras"], "Show samplers in user interface", gr.CheckboxGroup, lambda: {"choices": [x.name for x in list_samplers() if x.name != "PLMS"]}),
|
||||
"fallback_sampler": OptionInfo("Euler a", "Secondary sampler", gr.Dropdown, lambda: {"choices": ["None"] + [x.name for x in list_samplers()]}),
|
||||
"eta_ancestral": OptionInfo(1.0, "Noise multiplier for ancestral samplers (eta)", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}),
|
||||
"eta_ddim": OptionInfo(0.0, "Noise multiplier for DDIM (eta)", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}),
|
||||
|
||||
+8
-1
@@ -303,7 +303,14 @@ def create_output_panel(tabname, outdir):
|
||||
|
||||
def create_sampler_and_steps_selection(choices, tabname):
|
||||
with FormRow(elem_id=f"sampler_selection_{tabname}"):
|
||||
sampler_index = gr.Dropdown(label='Sampling method', elem_id=f"{tabname}_sampling", choices=[x.name for x in choices], value="UniPC" if tabname == 'txt2img' else "Euler a", type="index")
|
||||
if 'UniPC' in [sampler.name for sampler in choices]:
|
||||
chosen_sampler_name = 'UniPC'
|
||||
elif 'Euler a' in [sampler.name for sampler in choices]:
|
||||
chosen_sampler_name = 'Euler a'
|
||||
else:
|
||||
chosen_sampler_name = samplers[0].name
|
||||
|
||||
sampler_index = gr.Dropdown(label='Sampling method', elem_id=f"{tabname}_sampling", choices=[x.name for x in choices], value=chosen_sampler_name if tabname == 'txt2img' else "Euler a", type="index")
|
||||
steps = gr.Slider(minimum=1, maximum=150, step=1, elem_id=f"{tabname}_steps", label="Sampling steps", value=20)
|
||||
return steps, sampler_index
|
||||
|
||||
|
||||
Reference in New Issue
Block a user