diff options
author | zhaohu xing <32668889+920232796@users.noreply.github.com> | 2022-11-30 02:13:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-30 02:13:17 +0000 |
commit | 0831ab476c626eb796b609acf8771177692bfab7 (patch) | |
tree | ebae98ea40ecc5b34497424bee19310e9fac4068 /scripts | |
parent | ee3f5ea3eeb31f1ed72e2f0cbed2c00a782497d8 (diff) | |
parent | 4b3c5bc24bffdf429c463a465763b3077fe55eb8 (diff) | |
download | stable-diffusion-webui-gfx803-0831ab476c626eb796b609acf8771177692bfab7.tar.gz stable-diffusion-webui-gfx803-0831ab476c626eb796b609acf8771177692bfab7.tar.bz2 stable-diffusion-webui-gfx803-0831ab476c626eb796b609acf8771177692bfab7.zip |
Merge branch 'master' into master
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/xy_grid.py | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py index b0b9d84d..0f27deda 100644 --- a/scripts/xy_grid.py +++ b/scripts/xy_grid.py @@ -58,29 +58,19 @@ def apply_order(p, x, xs): prompt_tmp += part
prompt_tmp += x[idx]
p.prompt = prompt_tmp + p.prompt
-
-
-def build_samplers_dict():
- samplers_dict = {}
- for i, sampler in enumerate(sd_samplers.all_samplers):
- samplers_dict[sampler.name.lower()] = i
- for alias in sampler.aliases:
- samplers_dict[alias.lower()] = i
- 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 = sd_samplers.samplers_map.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 sd_samplers.samplers_map:
raise RuntimeError(f"Unknown sampler: {x}")
|