From ab82c172d5f1d6d1c190133c4981978726da912a Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 25 Sep 2025 14:02:21 -0400 Subject: [PATCH] handle nunchaku lora with unsupported models Signed-off-by: Vladimir Mandic --- modules/lora/lora_nunchaku.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/lora/lora_nunchaku.py b/modules/lora/lora_nunchaku.py index 63a71b46f..d01238449 100644 --- a/modules/lora/lora_nunchaku.py +++ b/modules/lora/lora_nunchaku.py @@ -8,6 +8,9 @@ previously_loaded = [] # we maintain private state here def load_nunchaku(names, strengths): global previously_loaded # pylint: disable=global-statement + if not hasattr(shared.sd_model, 'transformer') or not hasattr(shared.sd_model.transformer, 'update_lora_params'): + shared.log.error(f'Network load: type=LoRA method=nunchaku model={shared.sd_model.__class__.__name__} unsupported') + return False strengths = [s[0] if isinstance(s, list) else s for s in strengths] networks = lora_load.gather_networks(names) networks = [(network, strength) for network, strength in zip(networks, strengths) if network is not None and strength > 0] @@ -27,7 +30,7 @@ def load_nunchaku(names, strengths): lora_common.timer.load = t1 - t0 shared.log.debug(f"Network load: type=LoRA method=nunchaku loras={names} strength={strengths} time={t1-t0:.3f}") except Exception as e: - shared.log.errors(f'Network load: type=LoRA method=nunchaku {e}') + shared.log.error(f'Network load: type=LoRA method=nunchaku {e}') if lora_common.debug: errors.display(e, 'LoRA') return is_changed