Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

sampler_cfg_function now gets the noisy output as argument again.

comfyanonymousd2e27b48f169
diff --git a/comfy/samplers.py b/comfy/samplers.py
index 92ba5f8ec..22a9b68ae 100644
--- a/comfy/samplers.py
+++ b/comfy/samplers.py
@@ -251,8 +251,8 @@ def sampling_function(model_function, x, timestep, uncond, cond, cond_scale, mod
cond, uncond = calc_cond_uncond_batch(model_function, cond, uncond, x, timestep, max_total_area, model_options)
if "sampler_cfg_function" in model_options:
- args = {"cond": cond, "uncond": uncond, "cond_scale": cond_scale, "timestep": timestep}
- return model_options["sampler_cfg_function"](args)
+ args = {"cond": x - cond, "uncond": x - uncond, "cond_scale": cond_scale, "timestep": timestep, "input": x}
+ return x - model_options["sampler_cfg_function"](args)
else:
return uncond + (cond - uncond) * cond_scale