aboutsummaryrefslogtreecommitdiff
path: root/modules/processing.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-05-16 12:36:15 +0300
committerAUTOMATIC <16777216c@gmail.com>2023-05-16 12:36:15 +0300
commita61cbef02c7652f96d333b28e01f5230e225224e (patch)
tree73a4af202ff47e74b6ff94f404aaa23722143df4 /modules/processing.py
parentcdac5ace1456ba779d5a0171ff8757f31955bfee (diff)
add second_order field to sampler config
Diffstat (limited to 'modules/processing.py')
-rw-r--r--modules/processing.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/processing.py b/modules/processing.py
index 15806f78..678c4468 100644
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -681,12 +681,8 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
processed = Processed(p, [], p.seed, "")
file.write(processed.infotext(p, 0))
- step_multiplier = 1
- if not shared.opts.dont_fix_second_order_samplers_schedule:
- try:
- step_multiplier = 2 if sd_samplers.all_samplers_map.get(p.sampler_name).aliases[0] in ['k_dpmpp_2s_a', 'k_dpmpp_2s_a_ka', 'k_dpmpp_sde', 'k_dpmpp_sde_ka', 'k_dpm_2', 'k_dpm_2_a', 'k_heun'] else 1
- except Exception:
- pass
+ sampler_config = sd_samplers.find_sampler_config(p.sampler_name)
+ step_multiplier = 2 if sampler_config and sampler_config.options.get("second_order", False) else 1
uc = get_conds_with_caching(prompt_parser.get_learned_conditioning, negative_prompts, p.steps * step_multiplier, cached_uc)
c = get_conds_with_caching(prompt_parser.get_multicond_learned_conditioning, prompts, p.steps * step_multiplier, cached_c)