From 3de7d3bb25a3c60dc59e88114a97d3e0c19545a9 Mon Sep 17 00:00:00 2001 From: Balladie Date: Sun, 14 Sep 2025 15:30:45 +0900 Subject: [PATCH] remove redundant op when cfg_pp=False --- comfy/k_diffusion/sampling.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/comfy/k_diffusion/sampling.py b/comfy/k_diffusion/sampling.py index dadfb28ce..2a9561b80 100644 --- a/comfy/k_diffusion/sampling.py +++ b/comfy/k_diffusion/sampling.py @@ -859,7 +859,9 @@ def sample_dpmpp_2m_sde(model, x, sigmas, extra_args=None, callback=None, disabl current_denoised = uncond_denoised if cfg_pp else denoised x = sigmas[i + 1] / sigmas[i] * (-h * eta).exp() * x + alpha_t * (-h_eta).expm1().neg() * denoised - x = x + alpha_t * (-h_eta).exp().neg() * (current_denoised - denoised) + + if cfg_pp: + x = x + alpha_t * (-h_eta).exp().neg() * (current_denoised - denoised) if old_denoised is not None: r = h_last / h