mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-12-26 11:52:42 -08:00
pass samplers from UI by name, make it possible to use a sampler from infotext even if it's hidden in the dropdown
This commit is contained in:
parent
ae1bde1aa1
commit
70c63c1208
4 changed files with 30 additions and 26 deletions
|
|
@ -12,6 +12,7 @@ all_samplers_map = {x.name: x for x in all_samplers}
|
|||
samplers = []
|
||||
samplers_for_img2img = []
|
||||
samplers_map = {}
|
||||
samplers_hidden = {}
|
||||
|
||||
|
||||
def find_sampler_config(name):
|
||||
|
|
@ -38,11 +39,11 @@ def create_sampler(name, model):
|
|||
|
||||
|
||||
def set_samplers():
|
||||
global samplers, samplers_for_img2img
|
||||
global samplers, samplers_for_img2img, samplers_hidden
|
||||
|
||||
hidden = set(shared.opts.hide_samplers)
|
||||
samplers = [x for x in all_samplers if x.name not in hidden]
|
||||
samplers_for_img2img = [x for x in all_samplers if x.name not in hidden]
|
||||
samplers_hidden = set(shared.opts.hide_samplers)
|
||||
samplers = all_samplers
|
||||
samplers_for_img2img = all_samplers
|
||||
|
||||
samplers_map.clear()
|
||||
for sampler in all_samplers:
|
||||
|
|
@ -51,4 +52,8 @@ def set_samplers():
|
|||
samplers_map[alias.lower()] = sampler.name
|
||||
|
||||
|
||||
def visible_sampler_names():
|
||||
return [x.name for x in samplers if x.name not in samplers_hidden]
|
||||
|
||||
|
||||
set_samplers()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue