Fix SAG not working with cfg 1.0

This commit is contained in:
comfyanonymous
2023-12-18 17:03:32 -05:00
parent 8cf1daa108
commit 571ea8cdcc
3 changed files with 8 additions and 4 deletions

View File

@@ -244,7 +244,7 @@ def calc_cond_uncond_batch(model, cond, uncond, x_in, timestep, model_options):
#The main sampling function shared by all the samplers
#Returns denoised
def sampling_function(model, x, timestep, uncond, cond, cond_scale, model_options={}, seed=None):
if math.isclose(cond_scale, 1.0):
if math.isclose(cond_scale, 1.0) and model_options.get("disable_cfg1_optimization", False) == False:
uncond_ = None
else:
uncond_ = uncond