refactor(lora): walk one component list in both passes

Deactivate carried its own shorter copy of the component list, missing
text_encoder_4 and transformer_2. Nothing depends on the difference
today: layer names are stamped only on text_encoder, text_encoder_2,
unet, transformer and llm_adapter, so modules in the other components
are skipped by both passes. Sharing the list keeps the two from drifting
apart if that stamping ever widens.
This commit is contained in:
CalamitousFelicitousness
2026-08-30 05:03:11 +01:00
parent e8659c87ac
commit ee21c64e67
+1 -2
View File
@@ -16,7 +16,6 @@ applied_layers: list[str] = []
refused_writes: int = 0 # deltas the modules would not take on the last activate pass; infotext reports the network as partial
native_active: bool = False
default_components = ['text_encoder', 'text_encoder_2', 'text_encoder_3', 'text_encoder_4', 'unet', 'transformer', 'transformer_2', 'llm_adapter']
deactivate_components = ['text_encoder', 'text_encoder_2', 'text_encoder_3', 'unet', 'transformer', 'llm_adapter']
class ActivationPass:
@@ -369,7 +368,7 @@ def network_deactivate(include=None, exclude=None):
sd_model = prepare_model_for_write(getattr(shared.sd_model, "pipe", shared.sd_model))
group_offload = shared.opts.diffusers_offload_mode == "group"
group_stripped = {}
modules, _components, active_components, total = collect_components(sd_model, include, exclude, deactivate_components, restore_filtered=False)
modules, _components, active_components, total = collect_components(sd_model, include, exclude, default_components, restore_filtered=False)
pbar, task = pass_progress('deactivate', total, len(l.previously_loaded_networks) > 0 and l.debug)
refused = 0
with devices.inference_context(), pbar: