From 5d63447afbc44b377f706a5eb0430f85791dcf30 Mon Sep 17 00:00:00 2001 From: "Alex \"mcmonkey\" Goodwin" Date: Sat, 10 Aug 2024 05:59:56 -0700 Subject: [PATCH] skip dynthresh if mimic == cfg per chaotic reddit post https://www.reddit.com/r/StableDiffusion/comments/1enxcek/comment --- dynthres_comfyui.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dynthres_comfyui.py b/dynthres_comfyui.py index c8644f4..5893490 100644 --- a/dynthres_comfyui.py +++ b/dynthres_comfyui.py @@ -38,7 +38,10 @@ class DynamicThresholdingComfyNode: time_step = time_step[0].item() dynamic_thresh.step = 999 - time_step - return input - dynamic_thresh.dynthresh(cond, uncond, cond_scale, None) + if cond_scale == mimic_scale: + return input - (uncond + (cond - uncond) * cond_scale) + else: + return input - dynamic_thresh.dynthresh(cond, uncond, cond_scale, None) m = model.clone() m.set_model_sampler_cfg_function(sampler_dyn_thresh) @@ -73,7 +76,10 @@ class DynamicThresholdingSimpleComfyNode: time_step = time_step[0].item() dynamic_thresh.step = 999 - time_step - return input - dynamic_thresh.dynthresh(cond, uncond, cond_scale, None) + if cond_scale == mimic_scale: + return input - (uncond + (cond - uncond) * cond_scale) + else: + return input - dynamic_thresh.dynthresh(cond, uncond, cond_scale, None) m = model.clone() m.set_model_sampler_cfg_function(sampler_dyn_thresh)