From cf924af44ec7aa2c0668d95d014fbf272dc137b8 Mon Sep 17 00:00:00 2001 From: asagi4 <130366179+asagi4@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:13:16 +0300 Subject: [PATCH] Skip work if there's nothing to do See also #7 --- __init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 99e86bc..2f9e8b0 100644 --- a/__init__.py +++ b/__init__.py @@ -29,7 +29,7 @@ class Guider_AdaptiveGuidance(comfy.samplers.CFGGuider): cond = self.conds.get("positive") uncond = self.conds.get("negative") ts = timestep[0].item() - if self.threshold_timestep > ts: + if self.threshold_timestep > ts or self.cfg == 1.0: if self.uz_scale > 0.0: model_options = model_options.copy() model_options["sampler_cfg_function"] = self.zero_cond @@ -109,7 +109,7 @@ class Guider_PerpNegAG(comfy_extras.nodes_perpneg.Guider_PerpNeg): cond = self.conds.get("positive") uncond = self.conds.get("negative") ts = timestep[0].item() - if self.threshold_timestep > ts: + if self.threshold_timestep > ts or self.cfg == 1.0: if self.uz_scale > 0.0: model_options = model_options.copy() model_options["sampler_cfg_function"] = self.zero_cond