From 00eff5e803d1c5a725ef28ddb8505304286c79bb Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 11 Jun 2026 08:14:00 +0000 Subject: [PATCH 1/7] Fix PixelSmith proceeding on unsupported model types The unsupported-model warning fell through and switched non-SDXL models into PixelSmithXLPipeline with an SDXL VAE, corrupting the pipeline. Return early like every sibling script does after this check. https: //claude.ai/code/session_014QWKWgKvMevcuvfCnsYoT2 Co-Authored-By: Claude --- scripts/pixelsmith_ext.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/pixelsmith_ext.py b/scripts/pixelsmith_ext.py index bc73d1e4b..9de00ab99 100644 --- a/scripts/pixelsmith_ext.py +++ b/scripts/pixelsmith_ext.py @@ -46,6 +46,7 @@ class PixelSmithScript(scripts_manager.Script): supported_model_list = ['sdxl'] if shared.sd_model_type not in supported_model_list: log.warning(f'PixelSmith: class={shared.sd_model.__class__.__name__} model={shared.sd_model_type} required={supported_model_list}') + return None from scripts.pixelsmith import PixelSmithXLPipeline, PixelSmithVAE # pylint: disable=no-name-in-module self.orig_pipe = shared.sd_model self.orig_vae = shared.sd_model.vae From 7851afc707cf340cafc35615ac6383be01c4e2d0 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 11 Jun 2026 08:15:12 +0000 Subject: [PATCH 2/7] Fix IP-Instruct crash in after() hook The framework passes the script's ui values positionally, but after() only accepted keyword args, so every run raised TypeError after processing and the original pipeline was never restored. Accept *args like sibling scripts. https: //claude.ai/code/session_014QWKWgKvMevcuvfCnsYoT2 Co-Authored-By: Claude --- scripts/ipinstruct.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ipinstruct.py b/scripts/ipinstruct.py index b6ce43c96..c3b8206d7 100644 --- a/scripts/ipinstruct.py +++ b/scripts/ipinstruct.py @@ -106,7 +106,7 @@ class IPInstructScript(scripts_manager.Script): # p.extra_generation_params["IPInstruct"] = f'' return processed - def after(self, p: processing.StableDiffusionProcessing, processed: processing.Processed, **kwargs): # pylint: disable=unused-argument + def after(self, p: processing.StableDiffusionProcessing, processed: processing.Processed, *args): # pylint: disable=unused-argument if self.orig_pipe is not None: shared.sd_model = self.orig_pipe return processed From cfcc7c7338b05b9554887d83196e7ffd47bde4af Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 11 Jun 2026 08:11:20 +0000 Subject: [PATCH 3/7] Fix MuLan negative prompt overwriting the positive prompt When negative_prompt arrived as a list, the unwrap assigned it to p.prompt instead of p.negative_prompt, replacing the user's prompt with the negative prompt text and passing an unsupported list to the pipeline. https: //claude.ai/code/session_014QWKWgKvMevcuvfCnsYoT2 Co-Authored-By: Claude --- scripts/mulan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mulan.py b/scripts/mulan.py index 28a674b90..f2a8b6a4a 100644 --- a/scripts/mulan.py +++ b/scripts/mulan.py @@ -93,7 +93,7 @@ class MuLanScript(scripts_manager.Script): p.prompt = p.prompt[0] p.task_args['prompt'] = p.prompt if isinstance(p.negative_prompt, list): - p.prompt = p.negative_prompt[0] + p.negative_prompt = p.negative_prompt[0] p.task_args['negative_prompt'] = p.negative_prompt if pipe_type != ('sd15' if shared.sd_model_type == 'sd' else 'sdxl'): From fd38a9bf63b642482e406b71a4bf1cf6161237c2 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 11 Jun 2026 08:10:41 +0000 Subject: [PATCH 4/7] Fix FreeU crash in ConsiStory script Enabling FreeU called len() on the checkbox bool instead of the parsed preset list, raising TypeError and aborting the run. Even without the crash, all four FreeU parameters were passed the same value. Use the parsed freeu_preset values, and log the invalid input before clearing it. https: //claude.ai/code/session_014QWKWgKvMevcuvfCnsYoT2 Co-Authored-By: Claude --- scripts/consistory_ext.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/consistory_ext.py b/scripts/consistory_ext.py index f28fc3848..ad1880880 100644 --- a/scripts/consistory_ext.py +++ b/scripts/consistory_ext.py @@ -95,10 +95,10 @@ class ConsiStoryScript(scripts_manager.Script): try: freeu_preset = [float(f.strip()) for f in freeu_preset.split(',')] except Exception: - freeu_preset = [] log.warning(f'ConsiStory: freeu="{freeu_preset}" invalid') - if len(freeu) == 4: - shared.sd_model.enable_freeu(s1=freeu[0], s2=freeu[0], b1=freeu[0], b2=freeu[0]) + freeu_preset = [] + if len(freeu_preset) == 4: + shared.sd_model.enable_freeu(s1=freeu_preset[0], s2=freeu_preset[1], b1=freeu_preset[2], b2=freeu_preset[3]) steps = 50 if steps else p.steps if injection: try: From ba8b6d23e8ceea3e5530a145cf7106f64486107f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 11 Jun 2026 08:11:38 +0000 Subject: [PATCH 5/7] Fix LBM output never resized back to input dimensions PIL Image.resize returns a new image; the result was discarded, so the final output stayed at the snapped aspect-ratio bucket size instead of being restored to the original input size. https: //claude.ai/code/session_014QWKWgKvMevcuvfCnsYoT2 Co-Authored-By: Claude --- scripts/lbm_ext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lbm_ext.py b/scripts/lbm_ext.py index 02d0675a7..c3352e0bc 100644 --- a/scripts/lbm_ext.py +++ b/scripts/lbm_ext.py @@ -131,7 +131,7 @@ class LBMScript(scripts_manager.Script): model.to(device=devices.cpu) if output_image is not None: - output_image.resize((ori_h_bg, ori_w_bg)) + output_image = output_image.resize((ori_h_bg, ori_w_bg)) return processing.get_processed(p, [output_image]) else: return processing.Processed(p, []) From 642e891c8161ae2e7b8c74f175a70d86c117937f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 11 Jun 2026 08:12:03 +0000 Subject: [PATCH 6/7] Fix AnimateDiff error reporting errors.display received the literal string 'e' instead of the caught exception, losing the traceback on adapter load failures. The restore debug log also nulled loaded_adapter before printing it, so it always showed adapter=None. https: //claude.ai/code/session_014QWKWgKvMevcuvfCnsYoT2 Co-Authored-By: Claude --- scripts/animatediff.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/animatediff.py b/scripts/animatediff.py index bb7570488..1509ce223 100644 --- a/scripts/animatediff.py +++ b/scripts/animatediff.py @@ -47,12 +47,12 @@ def set_adapter(adapter_name: str = 'None'): global motion_adapter, loaded_adapter, orig_pipe # pylint: disable=global-statement # adapter_name = name if name is not None and isinstance(name, str) else loaded_adapter if adapter_name is None or adapter_name == 'None' or not shared.sd_loaded: - motion_adapter = None - loaded_adapter = None if orig_pipe is not None: log.debug(f'AnimateDiff restore pipeline: adapter="{loaded_adapter}"') shared.sd_model = orig_pipe orig_pipe = None + motion_adapter = None + loaded_adapter = None return if shared.sd_model_type != 'sd' and shared.sd_model_type != 'sdxl' and not (shared.sd_model.__class__.__name__ == 'AnimateDiffPipeline' or shared.sd_model.__class__.__name__ == 'AnimateDiffSDXLPipeline'): log.warning(f'AnimateDiff: unsupported model type: {shared.sd_model.__class__.__name__}') @@ -133,7 +133,7 @@ def set_adapter(adapter_name: str = 'None'): loaded_adapter = None log.error(f'AnimateDiff load error: adapter="{adapter_name}" {e}') from modules import errors - errors.display('e', 'AnimateDiff') + errors.display(e, 'AnimateDiff') def set_scheduler(p, model, override: bool = False): From 6ef1228727e89ec5d19e94784761aa153588a6cf Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 11 Jun 2026 08:18:03 +0000 Subject: [PATCH 7/7] Fix per-script timing always recording zero ScriptSummary.record reset the reference timestamp immediately before measuring against it, so every recorded duration was ~0 and report() never logged script timings. Measure against the previous timestamp, then advance it. https: //claude.ai/code/session_014QWKWgKvMevcuvfCnsYoT2 Co-Authored-By: Claude --- modules/scripts_manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/scripts_manager.py b/modules/scripts_manager.py index 57824b159..d47d22197 100644 --- a/modules/scripts_manager.py +++ b/modules/scripts_manager.py @@ -345,8 +345,9 @@ class ScriptSummary: self.time = {} def record(self, script): - self.update = time.time() - self.time[script] = round(time.time() - self.update, 2) + now = time.time() + self.time[script] = round(now - self.update, 2) + self.update = now def report(self): total = sum(self.time.values())