From 24c3ce206a6493c3180fb71a970d5f122cc52fba Mon Sep 17 00:00:00 2001 From: AlUlkesh <99896447+AlUlkesh@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:24:31 +0200 Subject: [PATCH] Fallback if webui is an old version without sd_samplers_timesteps, #39 --- scripts/sd_save_intermediate_images.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/sd_save_intermediate_images.py b/scripts/sd_save_intermediate_images.py index 89fea1b..112843c 100644 --- a/scripts/sd_save_intermediate_images.py +++ b/scripts/sd_save_intermediate_images.py @@ -13,7 +13,13 @@ from modules import script_callbacks from modules.processing import Processed, process_images, fix_seed, create_infotext from modules.sd_samplers_kdiffusion import KDiffusionSampler -from modules.sd_samplers_timesteps import CompVisSampler as TimestepsSampler, samplers_timesteps +try: + from modules.sd_samplers_timesteps import CompVisSampler as TimestepsSampler, samplers_timesteps +except: + # Fallback if webui is an old version without sd_samplers_timesteps + class TimestepsSampler: + callback_state = None + from modules.sd_samplers_compvis import samplers_data_compvis as samplers_timesteps from modules.sd_samplers_common import sample_to_image from modules.images import save_image, FilenameGenerator, get_next_sequence_number from modules.shared import opts, state, cmd_opts