Nodes/Realtime LoRA Trainer/Selective LoRA Loader (Z-Image)
ComfyUI Node

Selective LoRA Loader (Z-Image)

Turn individual layers on and off

By shootthesound·Created 8 months ago·Updated 2 months ago· 538
Selective LoRA Loader (Z-Image)
  • model
  • clip
  • model
  • clip
  • info
lora_name
strength1.00
presetAll Layers
layer_0true
layer_0_str1.00
layer_1true
layer_1_str1.00
layer_2true
layer_2_str1.00
layer_3true
layer_3_str1.00
layer_4true
layer_4_str1.00
layer_5true
layer_5_str1.00
layer_6true
layer_6_str1.00
layer_7true
layer_7_str1.00
layer_8true
layer_8_str1.00
layer_9true
layer_9_str1.00
layer_10true
layer_10_str1.00
layer_11true
layer_11_str1.00
layer_12true
layer_12_str1.00
layer_13true
layer_13_str1.00
layer_14true
layer_14_str1.00
layer_15true
layer_15_str1.00
layer_16true
layer_16_str1.00
layer_17true
layer_17_str1.00
layer_18true
layer_18_str1.00
layer_19true
layer_19_str1.00
layer_20true
layer_20_str1.00
layer_21true
layer_21_str1.00
layer_22true
layer_22_str1.00
layer_23true
layer_23_str1.00
layer_24true
layer_24_str1.00
layer_25true
layer_25_str1.00
layer_26true
layer_26_str1.00
layer_27true
layer_27_str1.00
layer_28true
layer_28_str1.00
layer_29true
layer_29_str1.00
other_weightstrue
other_weights_str1.00
lora_path_opt
analysis_json

What it is

A normal LoRA loader gives you one strength slider for the whole adapter. This one gives you 30 - one per transformer layer in Z-Image, plus an "other weights" catch-all for anything outside the published layer list. It exists for a specific, common complaint: a Z-Image LoRA nails your subject's face but drags along style baggage you didn't ask for, or two LoRAs stacked together collapse into mush. Turning off the layers that aren't pulling their weight for your use case fixes both.

This is genuinely useful territory, not a gimmick. The pack's own author, testing this on his release thread, found that character likeness on Z-Image concentrates in the late layers - roughly 18 through 28 - while style tends to spread across the earlier layers and the "other weights" bucket. His own workaround: chain two of these loaders, each pointed at a different LoRA, and split the range - take style from LoRA A's early layers, identity from LoRA B's late ones. That's the move this node is built for.

How it works

A LoRA doesn't apply as one blob; it's a set of small weight deltas, one set per transformer layer (plus some miscellaneous weights that don't map cleanly to a layer index - the "other weights" bucket). This node loads the LoRA file, then lets you individually disable or reweight each layer's delta before it patches onto your model and CLIP. Feed in the optional analysis_json from LoRALoaderWithAnalysis and the checkboxes color themselves by measured impact - blue for low, red for very high - so you're not guessing which layers matter for the specific LoRA you loaded.

Inputs and outputs that matter

  • model, clip, lora_name - the standard trio any LoRA loader needs.
  • strength - the global multiplier (-5 to 5) applied on top of whatever per-layer strengths you set.
  • preset - a dropdown of ready-made layer selections: Late Only (20–29), Mid-Late (15–29), Skip Early (10–29), Peak Impact (18–25), Face Priority (16–24) and an Aggressive variant, Evens/Odds Only, and more. Given the author's own finding above, Late Only or Peak Impact is a reasonable first thing to try if a character LoRA is bleeding style it shouldn't.
  • layer_0 through layer_29, each paired with a _str strength slider - toggle and reweight any individual layer.
  • other_weights / other_weights_str - the catch-all for weights outside the numbered layers; the author notes some LoRAs concentrate real signal here, so don't ignore it if a layer-only edit isn't producing the effect you expect.
  • Optional lora_path_opt overrides the dropdown with a direct file path - useful chained straight off a trainer node's output. Optional analysis_json enables the impact-colored checkboxes.

Outputs: model, clip (both patched, wire onward as usual), and info - a text summary of what got applied.

Installing it

This node works the moment the pack is installed - no external trainer backend required. ComfyUI Manager (search "Realtime LoRA Trainer") or:

cd ComfyUI/custom_nodes
git clone https://github.com/ShootTheSound/comfyUI-Realtime-Lora

Restart ComfyUI.

Common issues

Turning off a layer doesn't visibly change anything. Not every layer carries meaningful weight for every LoRA - run LoRA Loader + Analyzer first and feed its analysis_json in here, so the checkboxes tell you which layers are actually worth touching instead of clicking through all 30 blind.

LoRA looks weaker overall after disabling layers. Expected - you removed some of its total contribution. Compensate by raising strength or the remaining layers' individual _str sliders rather than assuming the LoRA itself got worse.

Style bleed persists even with early layers off. Check other_weights - some LoRAs (this shows up especially with LoKr-format Z-Image LoRAs, which the community has increasingly moved to for character work) park a surprising amount of signal outside the numbered layers, and that bucket needs its own toggle.

Categoryloaders/lora

Inputs (69)

NameTypeDefaultDescription
modelMODEL
clipCLIP
lora_nameCOMBOZ-Image LoRA file to load
strengthFLOAT1.00-5–5Overall LoRA strength
presetCOMBOAll LayersQuick preset selection. Choose 'Custom' to use individual toggles below.
layer_0BOOLEANtrue
layer_0_strFLOAT1.00-5–5
layer_1BOOLEANtrue
layer_1_strFLOAT1.00-5–5
layer_2BOOLEANtrue
layer_2_strFLOAT1.00-5–5
layer_3BOOLEANtrue
layer_3_strFLOAT1.00-5–5
layer_4BOOLEANtrue
layer_4_strFLOAT1.00-5–5
layer_5BOOLEANtrue
layer_5_strFLOAT1.00-5–5
layer_6BOOLEANtrue
layer_6_strFLOAT1.00-5–5
layer_7BOOLEANtrue
layer_7_strFLOAT1.00-5–5
layer_8BOOLEANtrue
layer_8_strFLOAT1.00-5–5
layer_9BOOLEANtrue
layer_9_strFLOAT1.00-5–5
layer_10BOOLEANtrue
layer_10_strFLOAT1.00-5–5
layer_11BOOLEANtrue
layer_11_strFLOAT1.00-5–5
layer_12BOOLEANtrue
layer_12_strFLOAT1.00-5–5
layer_13BOOLEANtrue
layer_13_strFLOAT1.00-5–5
layer_14BOOLEANtrue
layer_14_strFLOAT1.00-5–5
layer_15BOOLEANtrue
layer_15_strFLOAT1.00-5–5
layer_16BOOLEANtrue
layer_16_strFLOAT1.00-5–5
layer_17BOOLEANtrue
layer_17_strFLOAT1.00-5–5
layer_18BOOLEANtrue
layer_18_strFLOAT1.00-5–5
layer_19BOOLEANtrue
layer_19_strFLOAT1.00-5–5
layer_20BOOLEANtrue
layer_20_strFLOAT1.00-5–5
layer_21BOOLEANtrue
layer_21_strFLOAT1.00-5–5
layer_22BOOLEANtrue
layer_22_strFLOAT1.00-5–5
layer_23BOOLEANtrue
layer_23_strFLOAT1.00-5–5
layer_24BOOLEANtrue
layer_24_strFLOAT1.00-5–5
layer_25BOOLEANtrue
layer_25_strFLOAT1.00-5–5
layer_26BOOLEANtrue
layer_26_strFLOAT1.00-5–5
layer_27BOOLEANtrue
layer_27_strFLOAT1.00-5–5
layer_28BOOLEANtrue
layer_28_strFLOAT1.00-5–5
layer_29BOOLEANtrue
layer_29_strFLOAT1.00-5–5
other_weightsBOOLEANtrue
other_weights_strFLOAT1.00-5–5
lora_path_optoptSTRINGOptional: Connect from LoRA Analyzer to use its selected LoRA
analysis_jsonoptSTRINGOptional: Connect from LoRA Analyzer for impact-colored checkboxes

Outputs (3)

NameTypeDescription
modelMODEL
clipCLIP
infoSTRING