From 40ca34b837b5068ec35b8d5681bae32cf28f5816 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Sun, 27 Nov 2022 13:17:39 +0300 Subject: fix for broken sampler selection in img2img and xy plot #4860 #4909 --- scripts/xy_grid.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts/xy_grid.py') diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py index b0b9d84d..2517c47d 100644 --- a/scripts/xy_grid.py +++ b/scripts/xy_grid.py @@ -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}") -- cgit v1.2.1