fix for broken sampler selection in img2img and xy plot #4860 #4909

This commit is contained in:
AUTOMATIC
2022-11-27 13:17:39 +03:00
parent 5b2c316890
commit 40ca34b837
3 changed files with 9 additions and 9 deletions

View File

@@ -62,25 +62,25 @@ def apply_order(p, x, xs):
def build_samplers_dict():
samplers_dict = {}
for i, sampler in enumerate(sd_samplers.all_samplers):
samplers_dict[sampler.name.lower()] = i
for sampler in sd_samplers.all_samplers:
samplers_dict[sampler.name.lower()] = sampler.name
for alias in sampler.aliases:
samplers_dict[alias.lower()] = i
samplers_dict[alias.lower()] = sampler.name
return samplers_dict
def apply_sampler(p, x, xs):
sampler_index = build_samplers_dict().get(x.lower(), None)
if sampler_index is None:
sampler_name = build_samplers_dict().get(x.lower(), None)
if sampler_name is None:
raise RuntimeError(f"Unknown sampler: {x}")
p.sampler_index = sampler_index
p.sampler_name = sampler_name
def confirm_samplers(p, xs):
samplers_dict = build_samplers_dict()
for x in xs:
if x.lower() not in samplers_dict.keys():
if x.lower() not in samplers_dict:
raise RuntimeError(f"Unknown sampler: {x}")