sampler_cfg_function now uses a dict for the argument.

This means arguments can be added without issues.
This commit is contained in:
comfyanonymous
2023-06-13 16:05:26 -04:00
parent d52ed407a7
commit 388567f20b
2 changed files with 7 additions and 3 deletions

View File

@@ -273,7 +273,8 @@ def sampling_function(model_function, x, timestep, uncond, cond, cond_scale, con
max_total_area = model_management.maximum_batch_area()
cond, uncond = calc_cond_uncond_batch(model_function, cond, uncond, x, timestep, max_total_area, cond_concat, model_options)
if "sampler_cfg_function" in model_options:
return model_options["sampler_cfg_function"](cond, uncond, cond_scale)
args = {"cond": cond, "uncond": uncond, "cond_scale": cond_scale, "timestep": timestep}
return model_options["sampler_cfg_function"](args)
else:
return uncond + (cond - uncond) * cond_scale