The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Add 'input_cond' and 'input_uncond' to the args dictionary passed into sampler_cfg_function (#10044)
Jedrzej Kosinski196954ab8c55
diff --git a/comfy/samplers.py b/comfy/samplers.pyindex b3202cec6..c59e296a1 100755--- a/comfy/samplers.py+++ b/comfy/samplers.py@@ -360,7 +360,7 @@ def calc_cond_uncond_batch(model, cond, uncond, x_in, timestep, model_options):def cfg_function(model, cond_pred, uncond_pred, cond_scale, x, timestep, model_options={}, cond=None, uncond=None):if "sampler_cfg_function" in model_options:args = {"cond": x - cond_pred, "uncond": x - uncond_pred, "cond_scale": cond_scale, "timestep": timestep, "input": x, "sigma": timestep,- "cond_denoised": cond_pred, "uncond_denoised": uncond_pred, "model": model, "model_options": model_options}+ "cond_denoised": cond_pred, "uncond_denoised": uncond_pred, "model": model, "model_options": model_options, "input_cond": cond, "input_uncond": uncond}cfg_result = x - model_options["sampler_cfg_function"](args)else:cfg_result = uncond_pred + (cond_pred - uncond_pred) * cond_scale@@ -390,7 +390,7 @@ def sampling_function(model, x, timestep, uncond, cond, cond_scale, model_optionfor fn in model_options.get("sampler_pre_cfg_function", []):args = {"conds":conds, "conds_out": out, "cond_scale": cond_scale, "timestep": timestep,"input": x, "sigma": timestep, "model": model, "model_options": model_options}- out = fn(args)+ out = fn(args)return cfg_function(model, out[0], out[1], cond_scale, x, timestep, model_options=model_options, cond=cond, uncond=uncond_)