From b90afe1253e56efbf4625960f12a83595c35c1f6 Mon Sep 17 00:00:00 2001 From: CalamitousFelicitousness Date: Sun, 19 Jul 2026 18:04:15 +0100 Subject: [PATCH] fix(lora): report the effective weight-state mode in load logs The mode field printed the configured fuse-or-backup strategy, which predates the factor path and reads as mode=backup on loads that took no backup at all. It now reports what the load actually holds: backup when weight backups were taken, fuse when fusing is active, factor when the whole load rode the svd channel and unload just drops factors. --- modules/lora/extra_networks_lora.py | 4 ++-- modules/lora/networks.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/lora/extra_networks_lora.py b/modules/lora/extra_networks_lora.py index b08dbfaf8..7d277e413 100644 --- a/modules/lora/extra_networks_lora.py +++ b/modules/lora/extra_networks_lora.py @@ -259,7 +259,7 @@ class ExtraNetworkLora(extra_networks.ExtraNetwork): if has_changed: jobid = shared.state.begin('LoRA') if len(l.previously_loaded_networks) > 0: - log.info(f'Network unload: type=LoRA networks={[n.name for n in l.previously_loaded_networks]} mode={"fuse" if lora_overrides.fuse_native() else "backup"}') + log.info(f'Network unload: type=LoRA networks={[n.name for n in l.previously_loaded_networks]} mode={networks.effective_mode()}') networks.network_deactivate(include, exclude) networks.network_activate(include, exclude) debug_log(f'Network change: type=LoRA previous={[n.name for n in l.previously_loaded_networks]} current={[n.name for n in l.loaded_networks]}') @@ -272,7 +272,7 @@ class ExtraNetworkLora(extra_networks.ExtraNetwork): prompt(p) if has_changed and len(include) == 0: # print only once actual_method = 'native' if any(len(n.modules) > 0 for n in l.loaded_networks) else load_method - log.info(f'Network load: type=LoRA networks={[n.name for n in l.loaded_networks]} load={load_method}({load_reason}) method={actual_method} mode={"fuse" if lora_overrides.fuse_native() else "backup"} te={te_multipliers} unet={unet_multipliers} time={l.timer.summary} reason="{reason}"') + log.info(f'Network load: type=LoRA networks={[n.name for n in l.loaded_networks]} load={load_method}({load_reason}) method={actual_method} mode={networks.effective_mode()} te={te_multipliers} unet={unet_multipliers} time={l.timer.summary} reason="{reason}"') def deactivate(self, p, force=False): if len(lora_diffusers.diffuser_loaded) > 0 and (shared.opts.lora_force_reload or force): diff --git a/modules/lora/networks.py b/modules/lora/networks.py index 818f3c100..c0ffef6b1 100644 --- a/modules/lora/networks.py +++ b/modules/lora/networks.py @@ -222,6 +222,7 @@ def network_activate(include=None, exclude=None): lora_sdnq.report_fallbacks() native_active = len(l.loaded_networks) > 0 refused_writes = refused + l.last_backup_size = backup_size l.timer.activate += time.time() - t0 if refused > 0: log.error(f'Network load: type=LoRA networks={[n.name for n in l.loaded_networks]} weights={applied_weight} bias={applied_bias} refused={refused} network partially applied') @@ -232,6 +233,15 @@ def network_activate(include=None, exclude=None): sd_models.set_diffuser_offload(sd_model, op="model") +def effective_mode(): + """Weight-state label for load logs: backup and fuse say how touched weights restore, factor means the whole load rode the svd channel and unload just drops factors.""" + if getattr(l, 'last_backup_size', 0) > 0: + return 'backup' + if lora_overrides.fuse_native(): + return 'fuse' + return 'factor' + + def network_deactivate(include=None, exclude=None): if exclude is None: exclude = []