Unverified Commit d6a3988b authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub
Browse files

Merge pull request #9669 from catboxanon/patch/sampler-schedule-fix

Fix prompt schedule for second order samplers
parents fc6eeda6 9de72988
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -642,8 +642,14 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
                    processed = Processed(p, [], p.seed, "")
                    processed = Processed(p, [], p.seed, "")
                    file.write(processed.infotext(p, 0))
                    file.write(processed.infotext(p, 0))


            uc = get_conds_with_caching(prompt_parser.get_learned_conditioning, negative_prompts, p.steps, cached_uc)
            step_multiplier = 1
            c = get_conds_with_caching(prompt_parser.get_multicond_learned_conditioning, prompts, p.steps, cached_c)
            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:
            if len(model_hijack.comments) > 0:
                for comment in model_hijack.comments:
                for comment in model_hijack.comments:
+1 −0
Original line number Original line Diff line number Diff line
@@ -360,6 +360,7 @@ options_templates.update(options_section(('compatibility', "Compatibility"), {
    "use_old_karras_scheduler_sigmas": OptionInfo(False, "Use old karras scheduler sigmas (0.1 to 10)."),
    "use_old_karras_scheduler_sigmas": OptionInfo(False, "Use old karras scheduler sigmas (0.1 to 10)."),
    "no_dpmpp_sde_batch_determinism": OptionInfo(False, "Do not make DPM++ SDE deterministic across different batch sizes."),
    "no_dpmpp_sde_batch_determinism": OptionInfo(False, "Do not make DPM++ SDE deterministic across different batch sizes."),
    "use_old_hires_fix_width_height": OptionInfo(False, "For hires fix, use width/height sliders to set final resolution rather than first pass (disables Upscale by, Resize width/height to)."),
    "use_old_hires_fix_width_height": OptionInfo(False, "For hires fix, use width/height sliders to set final resolution rather than first pass (disables Upscale by, Resize width/height to)."),
    "dont_fix_second_order_samplers_schedule": OptionInfo(False, "Do not fix prompt schedule for second order samplers."),
}))
}))


options_templates.update(options_section(('interrogate', "Interrogate Options"), {
options_templates.update(options_section(('interrogate', "Interrogate Options"), {