From f44225fd5f433daf78484b9c21b9b777bea04220 Mon Sep 17 00:00:00 2001 From: Jedrzej Kosinski Date: Fri, 9 Feb 2024 17:11:34 -0600 Subject: [PATCH] Fix infinite while loop being possible in ddim_scheduler --- comfy/samplers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/samplers.py b/comfy/samplers.py index f4c3e26..f2ac3c5 100644 --- a/comfy/samplers.py +++ b/comfy/samplers.py @@ -295,7 +295,7 @@ def simple_scheduler(model, steps): def ddim_scheduler(model, steps): s = model.model_sampling sigs = [] - ss = len(s.sigmas) // steps + ss = max(len(s.sigmas) // steps, 1) x = 1 while x < len(s.sigmas): sigs += [float(s.sigmas[x])]