From 2bcff674806feb191c69ca50a4dc17386ea27551 Mon Sep 17 00:00:00 2001 From: Wagner Bruna Date: Sat, 18 Apr 2026 03:54:41 -0300 Subject: [PATCH] fix: correct dpm++2s_a second model call (#1435) --- src/denoiser.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/denoiser.hpp b/src/denoiser.hpp index e4303f58..7399e861 100644 --- a/src/denoiser.hpp +++ b/src/denoiser.hpp @@ -953,8 +953,9 @@ static sd::Tensor sample_dpmpp_2s_ancestral(denoise_cb_t model, float t_next = t_fn(sigma_down); float h = t_next - t; float s = t + 0.5f * h; - sd::Tensor x2 = (sigma_fn(s) / sigma_fn(t)) * x - (exp(-h * 0.5f) - 1) * denoised; - auto denoised2_opt = model(x2, sigmas[i + 1], i + 1); + float sigma_s = sigma_fn(s); + sd::Tensor x2 = (sigma_s / sigma_fn(t)) * x - (exp(-h * 0.5f) - 1) * denoised; + auto denoised2_opt = model(x2, sigma_s, i + 1); if (denoised2_opt.empty()) { return {}; }