From 20efcba3914565e3556fccbdbf22fdf8cda33843 Mon Sep 17 00:00:00 2001 From: blepping Date: Fri, 15 Mar 2024 19:20:58 -0600 Subject: [PATCH] Fix assuming first/last steps would be set for non-custom restart samplers --- restart_sampling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/restart_sampling.py b/restart_sampling.py index 7a85508..5e29d9f 100644 --- a/restart_sampling.py +++ b/restart_sampling.py @@ -93,12 +93,12 @@ def restart_sampling(model, seed, steps, cfg, sampler, scheduler, positive, nega real_model, model.load_device, ) - if last_step < (len(sigmas) - 1): + if last_step is not None and last_step < (len(sigmas) - 1): sigmas = sigmas[:last_step + 1] if force_full_denoise: sigmas[-1] = 0 - if start_step < (len(sigmas) - 1): + if start_step is not None and start_step < (len(sigmas) - 1): sigmas = sigmas[start_step:] sampler_wrapper = KSamplerRestartWrapper(sampler, real_model, restart_scheduler, restart_segments, total_steps)