From c544038d6f29330886d89b1b4715d131430b3509 Mon Sep 17 00:00:00 2001 From: catboxanon <122327233+catboxanon@users.noreply.github.com> Date: Thu, 1 May 2025 18:35:12 -0400 Subject: [PATCH] Move computed interpolation outside loop --- comfy_extras/nodes_custom_sampler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comfy_extras/nodes_custom_sampler.py b/comfy_extras/nodes_custom_sampler.py index 47f8b8eac..758696478 100644 --- a/comfy_extras/nodes_custom_sampler.py +++ b/comfy_extras/nodes_custom_sampler.py @@ -278,6 +278,7 @@ class ExtendIntermediateSigmas: # linear space for our interpolation function x = torch.linspace(0, 1, steps + 1, device=sigmas.device)[1:-1] + computed_spacing = interpolator(x) extended_sigmas = [] for i in range(len(sigmas) - 1): @@ -287,7 +288,7 @@ class ExtendIntermediateSigmas: extended_sigmas.append(sigma_current) if end_at_sigma <= sigma_current <= start_at_sigma: - interpolated_steps = interpolator(x) * (sigma_next - sigma_current) + sigma_current + interpolated_steps = computed_spacing * (sigma_next - sigma_current) + sigma_current extended_sigmas.extend(interpolated_steps.tolist()) # Add the last sigma value