Working RescaleCFG node.

This was broken because of recent changes so I fixed it and moved it from
the experiments repo.
This commit is contained in:
comfyanonymous
2023-11-10 20:52:10 -05:00
parent 3e0033ef30
commit 58d5d71a93
2 changed files with 40 additions and 1 deletions

View File

@@ -248,7 +248,7 @@ 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": x - cond, "uncond": x - uncond, "cond_scale": cond_scale, "timestep": timestep, "input": x}
args = {"cond": x - cond, "uncond": x - uncond, "cond_scale": cond_scale, "timestep": timestep, "input": x, "sigma": timestep}
return x - model_options["sampler_cfg_function"](args)
else:
return uncond + (cond - uncond) * cond_scale