feat: sampler_cfg_rescaler timestep to sigma

This commit is contained in:
JettHu 2024-04-20 01:47:03 +08:00
parent 0b56c97717
commit cba9c66fd2

View File

@ -250,7 +250,7 @@ def cfg_function(model, cond_pred, uncond_pred, cond_scale, x, timestep, model_o
#Returns denoised
def sampling_function(model, x, timestep, uncond, cond, cond_scale, model_options={}, seed=None):
if "sampler_cfg_rescaler" in model_options:
cond_scale = model_options["sampler_cfg_rescaler"]({"cond_scale": cond_scale, "timestep": timestep})
cond_scale = model_options["sampler_cfg_rescaler"]({"cond_scale": cond_scale, "sigma": timestep})
if math.isclose(cond_scale, 1.0) and model_options.get("disable_cfg1_optimization", False) == False:
uncond_ = None
else: