3 Commits
Author SHA1 Message Date
asagi4 a5040a1b5c Release 0.3.1 2024-08-25 14:50:05 +03:00
asagi4 035cb39e22 Don't skip CFG *on* the threshold timestep
Should fix #9
2024-08-25 14:11:58 +03:00
asagi4 a54984bb98 Maybe the order of calculating these matters?
See #9
2024-08-24 21:19:52 +03:00
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ class AdaptiveGuider(object):
def predict_noise(self, x, timestep, model_options={}, seed=None):
ts = timestep[0].item()
if ts >= self.cfg_start_timestep or self.threshold_timestep > ts or self.cfg == 1.0:
if ts > self.cfg_start_timestep or 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
@@ -53,12 +53,12 @@ class Guider_AdaptiveGuidance(AdaptiveGuider, comfy.samplers.CFGGuider):
def calc_conds(self, x, timestep, model_options):
cond = self.conds.get("positive")
uncond = self.conds.get("negative")
return comfy.samplers.calc_cond_batch(self.inner_model, [uncond, cond], x, timestep, model_options)
return comfy.samplers.calc_cond_batch(self.inner_model, [cond, uncond], x, timestep, model_options)
def calc_cfg(self, conds, x, timestep, model_options):
cond = self.conds.get("positive")
uncond = self.conds.get("negative")
uncond_pred, cond_pred = conds
cond_pred, uncond_pred = conds
return comfy.samplers.cfg_function(
self.inner_model,
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-adaptive-guidance"
description = "An implementation of adaptive guidance for ComfyUI\nSee https://bcv-uniandes.github.io/adaptiveguidance-wp/"
version = "0.3.0"
version = "0.3.1"
license = { text = "GNU General Public License v3.0" }
[project.urls]