mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-15 07:52:35 +08:00
sampler_cfg_function get a true timestep
This commit is contained in:
parent
10b791ae4a
commit
3722b4e5f6
@ -251,7 +251,8 @@ def sampling_function(model, x, sigmas, uncond, cond, cond_scale, model_options=
|
|||||||
|
|
||||||
cond, uncond = calc_cond_uncond_batch(model, cond, uncond, x, sigmas, model_options)
|
cond, uncond = calc_cond_uncond_batch(model, cond, uncond, x, sigmas, model_options)
|
||||||
if "sampler_cfg_function" in model_options:
|
if "sampler_cfg_function" in model_options:
|
||||||
args = {"cond": x - cond, "uncond": x - uncond, "cond_scale": cond_scale, "input": x, "sigma": sigmas}
|
timesteps = model.model_sampling.timestep(sigmas)
|
||||||
|
args = {"cond": x - cond, "uncond": x - uncond, "cond_scale": cond_scale, "timestep": timesteps, "input": x, "sigma": sigmas}
|
||||||
return x - model_options["sampler_cfg_function"](args)
|
return x - model_options["sampler_cfg_function"](args)
|
||||||
else:
|
else:
|
||||||
return uncond + (cond - uncond) * cond_scale
|
return uncond + (cond - uncond) * cond_scale
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user