Nodes/Realtime LoRA Trainer/Wan Analyzer + Selective Loader V2
ComfyUI Node

Wan Analyzer + Selective Loader V2

Block-level control for Wan 2.2 LoRAs

By shootthesound·Created 8 months ago·Updated 2 months ago· 538
Wan Analyzer + Selective Loader V2
  • model
  • positive
  • negative
  • model
  • positive
  • negative
  • analysis
  • analysis_json
lora_name
strength1.00
presetDefault
block_0true
block_0_str1.00
block_1true
block_1_str1.00
block_2true
block_2_str1.00
block_3true
block_3_str1.00
block_4true
block_4_str1.00
block_5true
block_5_str1.00
block_6true
block_6_str1.00
block_7true
block_7_str1.00
block_8true
block_8_str1.00
block_9true
block_9_str1.00
block_10true
block_10_str1.00
block_11true
block_11_str1.00
block_12true
block_12_str1.00
block_13true
block_13_str1.00
block_14true
block_14_str1.00
block_15true
block_15_str1.00
block_16true
block_16_str1.00
block_17true
block_17_str1.00
block_18true
block_18_str1.00
block_19true
block_19_str1.00
block_20true
block_20_str1.00
block_21true
block_21_str1.00
block_22true
block_22_str1.00
block_23true
block_23_str1.00
block_24true
block_24_str1.00
block_25true
block_25_str1.00
block_26true
block_26_str1.00
block_27true
block_27_str1.00
block_28true
block_28_str1.00
block_29true
block_29_str1.00
block_30true
block_30_str1.00
block_31true
block_31_str1.00
block_32true
block_32_str1.00
block_33true
block_33_str1.00
block_34true
block_34_str1.00
block_35true
block_35_str1.00
block_36true
block_36_str1.00
block_37true
block_37_str1.00
block_38true
block_38_str1.00
block_39true
block_39_str1.00
other_weightstrue
other_weights_str1.00
lora_path_opt
schedule_presetCustom
strength_schedule
save_refined_lorafalse
save_path
save_filename

Wan character LoRAs have a known problem: stack more than one or two and quality collapses, or a single strong LoRA bleeds its face onto every character in frame. Block-level control is one of the few real levers against that, and this node is the whole toolkit - analyze which of Wan's 40 blocks a LoRA actually uses, then keep only the ones you want.

What it is and why you'd reach for it

Wan 2.2's DiT has 40 transformer blocks, and this node scores each one for a given LoRA (0-100% by weight magnitude) and gives you a toggle plus strength slider for every single one - live, in the same node that does the loading. That "combined" behavior is the V2 generation of this pack's design: earlier versions split analysis and selective loading across two nodes you had to wire together yourself.

This matters more for Wan than for most architectures. The community's documented failure mode with Wan character work is a LoRA's face bleeding across an entire scene when you only wanted it on one subject, or multiple LoRAs fighting each other into a blurry mess when stacked. Turning off the blocks a LoRA doesn't actually need is a direct answer to both: less surface area for a LoRA to interfere on, more headroom to stack a second one without collision.

It's one of 31 nodes in ShootTheSound/comfyUI-Realtime-Lora, which also trains Wan 2.2 LoRAs directly (High/Low/Combo noise modes) via Musubi Tuner, so you can go from training run to selectively-loaded LoRA without leaving the workflow.

How it works

The 40 blocks are grouped into rough zones - 0-9 early, 10-19 early-mid, 20-29 mid-late, 30-39 late - and there's an other_weights slider for anything a LoRA touches outside the numbered set, which matters more than it sounds: LoKR and LoHa (both auto-detected here) don't always land cleanly inside the numbered blocks. The V2 node also connects to analysis_json from a separate analyzer if you'd rather do a first pass elsewhere, and the checkboxes color themselves by impact once that's wired - blue low, red high.

Inputs and outputs that matter

  • model / positive / negative - the pipeline this patches; conditioning is touched too since V2's schedule hooks run through it.
  • lora_name, strength - pick and global weight.
  • preset - jump to Late Only (30-39), Mid-Late (20-39), Skip Early, Mid Only (15-25), Early Only, or Half Strength before hand-tuning individual blocks.
  • block_0 through block_39, plus other_weights - each a toggle with a -5 to 5 strength slider.
  • strength_schedule (optional) - step:strength pairs for fading the LoRA's strength across the run, with 40+ named presets.
  • save_refined_lora (optional) - bake your surviving-blocks combination into a new .safetensors file, so a stacking experiment that finally worked doesn't live only in your node graph's toggle state.
  • Outputs: model, positive, negative (patched), analysis (readable), analysis_json (for chaining).

Installing it

Search "Realtime LoRA Trainer" in ComfyUI Manager, or manually:

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

Restart ComfyUI. This node needs nothing beyond that - no video model, no training backend. Those are only relevant to the pack's Wan trainer node.

Troubleshooting

lora_name dropdown is empty. It only lists Wan LoRAs already sitting in your loras folder. If you just trained one with this pack's own Wan trainer, feed its lora_path output into lora_path_opt instead - the dropdown is ignored once that's connected.

Stacking two LoRAs still collapses quality even with blocks trimmed down. Selective loading reduces interference, it doesn't eliminate it - Wan's documented multi-LoRA problem is real and block trimming is a mitigation, not a fix. If two full-strength LoRAs still fight, try lowering the strength on the less important one before pruning more blocks off it.

A Wan 2.1-trained LoRA behaves oddly on 2.2. Wan 2.1 LoRAs are broadly forward-compatible with 2.2, but "compatible" isn't "identical" - the block impact map you see here is for whatever architecture you loaded the LoRA against, so re-run the analysis rather than assuming a 2.1 LoRA's block scores carry over unchanged.

Categoryloaders/lora

Inputs (94)

NameTypeDefaultDescription
modelMODEL
positiveCONDITIONINGPositive conditioning from CLIP encode
negativeCONDITIONINGNegative conditioning from CLIP encode
lora_nameCOMBOLoRA file to load and analyze
strengthFLOAT1.00-10–10Overall LoRA strength (ignored when using schedule)
presetCOMBODefaultQuick preset selection. Individual toggles below override when changed.
block_0BOOLEANtrue
block_0_strFLOAT1.00-5–5
block_1BOOLEANtrue
block_1_strFLOAT1.00-5–5
block_2BOOLEANtrue
block_2_strFLOAT1.00-5–5
block_3BOOLEANtrue
block_3_strFLOAT1.00-5–5
block_4BOOLEANtrue
block_4_strFLOAT1.00-5–5
block_5BOOLEANtrue
block_5_strFLOAT1.00-5–5
block_6BOOLEANtrue
block_6_strFLOAT1.00-5–5
block_7BOOLEANtrue
block_7_strFLOAT1.00-5–5
block_8BOOLEANtrue
block_8_strFLOAT1.00-5–5
block_9BOOLEANtrue
block_9_strFLOAT1.00-5–5
block_10BOOLEANtrue
block_10_strFLOAT1.00-5–5
block_11BOOLEANtrue
block_11_strFLOAT1.00-5–5
block_12BOOLEANtrue
block_12_strFLOAT1.00-5–5
block_13BOOLEANtrue
block_13_strFLOAT1.00-5–5
block_14BOOLEANtrue
block_14_strFLOAT1.00-5–5
block_15BOOLEANtrue
block_15_strFLOAT1.00-5–5
block_16BOOLEANtrue
block_16_strFLOAT1.00-5–5
block_17BOOLEANtrue
block_17_strFLOAT1.00-5–5
block_18BOOLEANtrue
block_18_strFLOAT1.00-5–5
block_19BOOLEANtrue
block_19_strFLOAT1.00-5–5
block_20BOOLEANtrue
block_20_strFLOAT1.00-5–5
block_21BOOLEANtrue
block_21_strFLOAT1.00-5–5
block_22BOOLEANtrue
block_22_strFLOAT1.00-5–5
block_23BOOLEANtrue
block_23_strFLOAT1.00-5–5
block_24BOOLEANtrue
block_24_strFLOAT1.00-5–5
block_25BOOLEANtrue
block_25_strFLOAT1.00-5–5
block_26BOOLEANtrue
block_26_strFLOAT1.00-5–5
block_27BOOLEANtrue
block_27_strFLOAT1.00-5–5
block_28BOOLEANtrue
block_28_strFLOAT1.00-5–5
block_29BOOLEANtrue
block_29_strFLOAT1.00-5–5
block_30BOOLEANtrue
block_30_strFLOAT1.00-5–5
block_31BOOLEANtrue
block_31_strFLOAT1.00-5–5
block_32BOOLEANtrue
block_32_strFLOAT1.00-5–5
block_33BOOLEANtrue
block_33_strFLOAT1.00-5–5
block_34BOOLEANtrue
block_34_strFLOAT1.00-5–5
block_35BOOLEANtrue
block_35_strFLOAT1.00-5–5
block_36BOOLEANtrue
block_36_strFLOAT1.00-5–5
block_37BOOLEANtrue
block_37_strFLOAT1.00-5–5
block_38BOOLEANtrue
block_38_strFLOAT1.00-5–5
block_39BOOLEANtrue
block_39_strFLOAT1.00-5–5
other_weightsBOOLEANtrue
other_weights_strFLOAT1.00-5–5
lora_path_optoptSTRINGOptional: Override LoRA selection with a path
schedule_presetoptCOMBOCustomSelect a preset schedule (populates the text field below for editing)
strength_scheduleoptSTRINGStrength schedule: 0:.2,.5:.8,1:1.0 (step:strength pairs). Edit freely after selecting preset.
save_refined_loraoptBOOLEANfalseEnable to save the refined LoRA to disk
save_pathoptSTRINGDirectory to save refined LoRA
save_filenameoptSTRINGFilename for saved LoRA (timestamp auto-appended). Leave empty for auto-name.

Outputs (5)

NameTypeDescription
modelMODELModel with LoRA applied (filtered by enabled blocks).
positiveCONDITIONINGPositive conditioning (with hooks if using schedule).
negativeCONDITIONINGNegative conditioning (with hooks if using schedule).
analysisSTRINGPer-block analysis showing impact scores.
analysis_jsonSTRINGJSON analysis data for UI coloring.