From f564943c3f3b8565851882bc2e3f37870123226f Mon Sep 17 00:00:00 2001 From: Wagner Bruna Date: Sat, 28 Mar 2026 13:58:53 -0300 Subject: [PATCH] fix: correct double increment on flow denoisers sigma calculations t_to_sigma already increments t, so it ends up generating wrong values for sigma_max (1.00033) and sigma_min. This affects schedulers that rely on those values: exponential, karras, bong_tangent and kl_optimal. bong_tangent 8 steps, before: 1.00033, 0.971839, 0.930154, 0.863995, 0.746076, 0.503155, 0.217895, 0.0752291, 0 after: 1, 0.97143, 0.929634, 0.863298, 0.745065, 0.501497, 0.215478, 0.0724315, 0 --- src/denoiser.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/denoiser.hpp b/src/denoiser.hpp index b92ca4e3f..2d02cb9a4 100644 --- a/src/denoiser.hpp +++ b/src/denoiser.hpp @@ -662,8 +662,8 @@ struct DiscreteFlowDenoiser : public Denoiser { } void set_parameters() { - for (int i = 1; i < TIMESTEPS + 1; i++) { - sigmas[i - 1] = t_to_sigma(static_cast(i)); + for (int i = 0; i < TIMESTEPS; i++) { + sigmas[i] = t_to_sigma(static_cast(i)); } }