diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-04-29 09:56:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-29 09:56:57 +0000 |
commit | d6a3988b86aaccc2df43c6786abfcc38294c66ba (patch) | |
tree | c7066a2b6fb6f27b8aa0d9003c1fcb07ad056efb /modules/processing.py | |
parent | fc6eeda69cb37c209754d113a61971d8490f7756 (diff) | |
parent | 9de7298898951d6038eeadee78f7be3b09d2cfc3 (diff) | |
download | stable-diffusion-webui-gfx803-d6a3988b86aaccc2df43c6786abfcc38294c66ba.tar.gz stable-diffusion-webui-gfx803-d6a3988b86aaccc2df43c6786abfcc38294c66ba.tar.bz2 stable-diffusion-webui-gfx803-d6a3988b86aaccc2df43c6786abfcc38294c66ba.zip |
Merge pull request #9669 from catboxanon/patch/sampler-schedule-fix
Fix prompt schedule for second order samplers
Diffstat (limited to 'modules/processing.py')
-rw-r--r-- | modules/processing.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/processing.py b/modules/processing.py index 7bac154d..98557fb1 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -642,8 +642,14 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed: processed = Processed(p, [], p.seed, "")
file.write(processed.infotext(p, 0))
- uc = get_conds_with_caching(prompt_parser.get_learned_conditioning, negative_prompts, p.steps, cached_uc)
- c = get_conds_with_caching(prompt_parser.get_multicond_learned_conditioning, prompts, p.steps, cached_c)
+ 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:
+ pass
+ 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)
if len(model_hijack.comments) > 0:
for comment in model_hijack.comments:
|