From d3cb546cc5041316f89a0bb860c780dc9ea135ef Mon Sep 17 00:00:00 2001 From: lllyasviel Date: Thu, 25 Jan 2024 19:44:25 -0800 Subject: [PATCH] Update sd_samplers_cfg_denoiser.py --- modules/sd_samplers_cfg_denoiser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/sd_samplers_cfg_denoiser.py b/modules/sd_samplers_cfg_denoiser.py index 770ab376..9ec6800f 100644 --- a/modules/sd_samplers_cfg_denoiser.py +++ b/modules/sd_samplers_cfg_denoiser.py @@ -90,9 +90,11 @@ class CFGDenoiser(torch.nn.Module): cfg_result = x - model_options["sampler_cfg_function"](args) else: cfg_result = uncond_pred + (cond_pred - uncond_pred) * cond_scale + # sanity_check = torch.allclose(cfg_result, denoised) for fn in model_options.get("sampler_post_cfg_function", []): - args = {"denoised": cfg_result, "cond": torch.zeros_like(uncond), "uncond": torch.zeros_like(uncond), "model": model, + args = {"denoised": cfg_result, "cond": torch.zeros_like(uncond), + "uncond": torch.zeros_like(uncond), "model": model, "uncond_denoised": uncond_pred, "cond_denoised": cond_pred, "sigma": timestep, "model_options": model_options, "input": x} cfg_result = fn(args)