Nodes/Realtime LoRA Trainer/Wan Model Layer Editor
ComfyUI Node

Wan Model Layer Editor

Scale Wan 2.2's 40 blocks on the base model, not the LoRA

By shootthesound·Created 10 months ago·Updated 2 months ago· 568
Wan Model Layer Editor
  • model
  • model
  • analysis
  • analysis_json
◄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►
◄othertrue►
◄other_str1.00►
◄save_preset_name►
◄delete_preset_name►
◄browser_presets_json{}►
◄save_modelfalse►
◄save_path►
◄save_filename►
◄source_model_path►

This node edits Wan 2.2's checkpoint directly, block by block, before any LoRA gets layered on top. If a particular block is consistently doing something you don't want across every generation - not just with one specific LoRA - this is where you fix it once, upstream.

What it is and why you'd reach for it

Wan 2.2's DiT has 40 blocks, and this node gives each one an independent -2 to 2 strength multiplier, with 1.0 as unchanged. It's the base-model counterpart to the pack's Wan selective LoRA loaders: those work on a LoRA's own weights, this works on the checkpoint the LoRA gets applied to. That distinction matters more on video models than it sounds - Wan's documented failure modes (a character's face bleeding across the whole scene, quality collapsing when you stack more than one or two LoRAs) are partly about LoRA interference, but a base-model edit that's consistently biasing generation in an unwanted direction affects every LoRA you ever load on top of it, so fixing it here instead of per-LoRA is the more durable move.

It's one of six model layer editors in ShootTheSound/comfyUI-Realtime-Lora. The pack's block guide for Wan's selective LoRA loaders groups the 40 blocks into rough zones - 0-9 early, 10-19 early-mid, 20-29 mid-late, 30-39 late - which is a reasonable starting map here too, even though this node is editing the base weights rather than a LoRA's.

Inputs and outputs that matter

  • model - the Wan 2.2 checkpoint to edit.
  • preset - Default, All Off, Half Strength, Late Only (30-39), or Custom.
  • block_0 through block_39, plus other for anything outside the numbered blocks - each with a toggle and a -2 to 2 strength slider.
  • Outputs: model (patched, feed downstream to your LoRA loader or sampler), info (a text summary of what was applied). Unlike the pack's other model layer editors, this one doesn't output a structured analysis_json - just the patched model and a readable report.

Installing it

ComfyUI Manager: search "Realtime LoRA Trainer." Manual:

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

Restart ComfyUI. No further install needed - model layer editors, like the rest of the pack's analysis and loading nodes, work out of the box. Video generation itself is still Wan's own VRAM burden regardless of this node; editing blocks doesn't reduce that.

Troubleshooting

Set a block to 0 and got artifacts instead of a clean removal. A strength of exactly 0.0 disrupts a block's residual path more aggressively than the number suggests - stay roughly in the 0.5-1.5 range for real adjustments, and treat the extremes as deliberate breakage tests rather than a normal setting.

Chained this after a LoRA loader and the effect got unpredictable. This node is meant to sit upstream - edit the base checkpoint here first, then let LoRAs patch on top of the edited version. Placed after a LoRA loader, you're scaling the LoRA's own contribution unevenly rather than the base model the block zones are describing.

Looking for the analysis_json output this pack's other model layer editors have. This node doesn't have one - it outputs model and info only. If you need structured per-block data to feed another node, use the info text output or work from the pack's Wan Analyzer + Selective Loader V2 instead, which is built for LoRA-side analysis with the fuller output set.

Categorymodel

Inputs (91)

NameTypeDefaultDescription
modelMODELModel from LoadCheckpoint or LoadDiffusionModel
presetCOMBODefaultQuick preset selection. Individual controls below override when changed.
block_0BOOLEANtrue—
block_0_strFLOAT1.00-2–2—
block_1BOOLEANtrue—
block_1_strFLOAT1.00-2–2—
block_2BOOLEANtrue—
block_2_strFLOAT1.00-2–2—
block_3BOOLEANtrue—
block_3_strFLOAT1.00-2–2—
block_4BOOLEANtrue—
block_4_strFLOAT1.00-2–2—
block_5BOOLEANtrue—
block_5_strFLOAT1.00-2–2—
block_6BOOLEANtrue—
block_6_strFLOAT1.00-2–2—
block_7BOOLEANtrue—
block_7_strFLOAT1.00-2–2—
block_8BOOLEANtrue—
block_8_strFLOAT1.00-2–2—
block_9BOOLEANtrue—
block_9_strFLOAT1.00-2–2—
block_10BOOLEANtrue—
block_10_strFLOAT1.00-2–2—
block_11BOOLEANtrue—
block_11_strFLOAT1.00-2–2—
block_12BOOLEANtrue—
block_12_strFLOAT1.00-2–2—
block_13BOOLEANtrue—
block_13_strFLOAT1.00-2–2—
block_14BOOLEANtrue—
block_14_strFLOAT1.00-2–2—
block_15BOOLEANtrue—
block_15_strFLOAT1.00-2–2—
block_16BOOLEANtrue—
block_16_strFLOAT1.00-2–2—
block_17BOOLEANtrue—
block_17_strFLOAT1.00-2–2—
block_18BOOLEANtrue—
block_18_strFLOAT1.00-2–2—
block_19BOOLEANtrue—
block_19_strFLOAT1.00-2–2—
block_20BOOLEANtrue—
block_20_strFLOAT1.00-2–2—
block_21BOOLEANtrue—
block_21_strFLOAT1.00-2–2—
block_22BOOLEANtrue—
block_22_strFLOAT1.00-2–2—
block_23BOOLEANtrue—
block_23_strFLOAT1.00-2–2—
block_24BOOLEANtrue—
block_24_strFLOAT1.00-2–2—
block_25BOOLEANtrue—
block_25_strFLOAT1.00-2–2—
block_26BOOLEANtrue—
block_26_strFLOAT1.00-2–2—
block_27BOOLEANtrue—
block_27_strFLOAT1.00-2–2—
block_28BOOLEANtrue—
block_28_strFLOAT1.00-2–2—
block_29BOOLEANtrue—
block_29_strFLOAT1.00-2–2—
block_30BOOLEANtrue—
block_30_strFLOAT1.00-2–2—
block_31BOOLEANtrue—
block_31_strFLOAT1.00-2–2—
block_32BOOLEANtrue—
block_32_strFLOAT1.00-2–2—
block_33BOOLEANtrue—
block_33_strFLOAT1.00-2–2—
block_34BOOLEANtrue—
block_34_strFLOAT1.00-2–2—
block_35BOOLEANtrue—
block_35_strFLOAT1.00-2–2—
block_36BOOLEANtrue—
block_36_strFLOAT1.00-2–2—
block_37BOOLEANtrue—
block_37_strFLOAT1.00-2–2—
block_38BOOLEANtrue—
block_38_strFLOAT1.00-2–2—
block_39BOOLEANtrue—
block_39_strFLOAT1.00-2–2—
otherBOOLEANtrue—
other_strFLOAT1.00-2–2—
save_preset_nameoptSTRINGEnter preset name, then click Save Preset button (or leave for file sync on execute)
delete_preset_nameoptSTRINGPreset to delete (filled automatically by Delete button)
browser_presets_jsonoptSTRING{}JSON of all browser presets (auto-filled by JS for sync)
save_modeloptBOOLEANfalseSave modified model to disk (large files!)
save_pathoptSTRINGDirectory to save modified model
save_filenameoptSTRINGFilename for saved model (timestamp added)
source_model_pathoptSTRINGPath to original model file (for copying metadata). Required for saved model to load correctly.

Outputs (3)

NameTypeDescription
modelMODELModel with block modifications applied
analysisSTRINGText analysis of model structure
analysis_jsonSTRINGJSON analysis data