From 431a2f7c3c9091c5a80cd75fb32dd051ca62099b Mon Sep 17 00:00:00 2001 From: "Alex \"mcmonkey\" Goodwin" Date: Fri, 10 Feb 2023 05:15:28 -0800 Subject: [PATCH] Fix img2img support --- scripts/dynamic_thresholding.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/dynamic_thresholding.py b/scripts/dynamic_thresholding.py index ef0d70d..88e4fb7 100644 --- a/scripts/dynamic_thresholding.py +++ b/scripts/dynamic_thresholding.py @@ -92,6 +92,8 @@ class Script(scripts.Script): p.sampler_name = fixed_sampler_name p.fixed_sampler_name = fixed_sampler_name sd_samplers.all_samplers_map[fixed_sampler_name] = newSampler + if p.sampler is not None: + p.sampler = sd_samplers.create_sampler(fixed_sampler_name, p.sd_model) def postprocess_batch(self, p, enabled, mimic_scale, threshold_percentile, mimic_mode, mimic_scale_min, cfg_mode, cfg_scale_min, powerscale_power, batch_number, images): if not enabled or not hasattr(p, 'orig_sampler_name'):