Z-Image Model Layer Editor
Scale the base model's layers before any LoRA touches it
- model
- model
- analysis
- analysis_json
Every other node in this pack that fiddles with blocks is doing it to a LoRA. This one is different: it edits the base checkpoint's 30 layers directly, before any LoRA is applied - turning down a layer that's biasing your output, or boosting one that's underperforming, as a permanent adjustment to the model itself rather than something a LoRA has to fight against.
What it is and why you'd reach for it
Z-Image's DiT has 30 layers, and this node scales each one's contribution independently - a strength multiplier between -2 and 2, with 1.0 meaning unchanged. The pack's own author has posted community findings on exactly this kind of layer analysis: in one documented case, an anatomical feature a user was training turned out to concentrate in layers 17-21, not the layers they expected, which is the whole reason a tool like this exists instead of guessing. Community testing elsewhere has similarly found Z-Image character likeness sitting in a fairly narrow late-layer band (roughly 18-28) with a lot of the style signal in weights outside the numbered layers entirely - which is why this node, like the pack's LoRA loaders, has a catch-all other slider alongside the 30 numbered ones.
This is base-model editing, not LoRA editing - you use it upstream of a LoRA loader, so whatever a LoRA does afterward is applying on top of your adjusted model rather than the two competing.
How it works
The pack groups Z-Image's 30 layers into rough zones: layers 0-9 handle early processing (structure), 10-19 mid processing (features), 20-29 late processing (details) - a coarser version of the finer sub-component breakdown the pack's separate DIT Deep Debiaser node offers for the same model, if block-level turns out not to be granular enough.
Inputs and outputs that matter
- model - the Z-Image checkpoint to edit.
- preset - Default, All Off, Half Strength, Late Only (20-29), Mid-Late (15-29), or Custom for hand-tuning individual layers.
- layer_0 through layer_29, each with a toggle and a -2 to 2 strength slider, plus other for weights outside the 30 named layers.
- save_preset_name / delete_preset_name (optional) - save your own toggle configuration under a name, or delete a saved one, so a combination you like doesn't have to be rebuilt from scratch next session.
- save_model / save_path / save_filename (optional) - export the edited checkpoint to disk as its own
.safetensorsfile. - source_model_path (optional) - a way to specify the original model's path for the save operation.
- Outputs: model (patched, feed to your sampler or a LoRA loader downstream), analysis (text summary), analysis_json (structured data for chaining).
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 extra install needed - model layer editors work out of the box like the pack's LoRA loaders and analyzers.
Troubleshooting
Set a layer to 0 strength and got noise instead of "no contribution." Zeroing out a layer entirely is more disruptive than a subtle edit - the pack's own debiaser nodes carry an explicit warning that 0.0 tends to produce artifacts rather than a clean absence, and the same caution applies here. Work in the 0.5-1.5 range for adjustments; save the extremes for deliberate experiments.
Edited the model but a LoRA applied afterward doesn't reflect the change. Order matters - this node needs to sit before your LoRA loader in the graph, editing the base model that the LoRA then patches on top of. If it's downstream of the LoRA instead, you're scaling the LoRA-modified model, which is a different (and less predictable) operation than what the block guide describes.
Trying to reproduce someone else's layer edit and it doesn't do the same thing. Presets and hand-tuned layer values are checkpoint-specific - the "18-28 controls likeness" pattern is a community observation on typical Z-Image behavior, not a universal constant, and a fine-tune or merge can shift where things land.
Inputs (71)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | Model from LoadCheckpoint or LoadDiffusionModel | |
| preset | COMBO | Default | Quick preset selection. Individual controls below override when changed. |
| layer_0 | BOOLEAN | true | — |
| layer_0_str | FLOAT | 1.00-2–2 | — |
| layer_1 | BOOLEAN | true | — |
| layer_1_str | FLOAT | 1.00-2–2 | — |
| layer_2 | BOOLEAN | true | — |
| layer_2_str | FLOAT | 1.00-2–2 | — |
| layer_3 | BOOLEAN | true | — |
| layer_3_str | FLOAT | 1.00-2–2 | — |
| layer_4 | BOOLEAN | true | — |
| layer_4_str | FLOAT | 1.00-2–2 | — |
| layer_5 | BOOLEAN | true | — |
| layer_5_str | FLOAT | 1.00-2–2 | — |
| layer_6 | BOOLEAN | true | — |
| layer_6_str | FLOAT | 1.00-2–2 | — |
| layer_7 | BOOLEAN | true | — |
| layer_7_str | FLOAT | 1.00-2–2 | — |
| layer_8 | BOOLEAN | true | — |
| layer_8_str | FLOAT | 1.00-2–2 | — |
| layer_9 | BOOLEAN | true | — |
| layer_9_str | FLOAT | 1.00-2–2 | — |
| layer_10 | BOOLEAN | true | — |
| layer_10_str | FLOAT | 1.00-2–2 | — |
| layer_11 | BOOLEAN | true | — |
| layer_11_str | FLOAT | 1.00-2–2 | — |
| layer_12 | BOOLEAN | true | — |
| layer_12_str | FLOAT | 1.00-2–2 | — |
| layer_13 | BOOLEAN | true | — |
| layer_13_str | FLOAT | 1.00-2–2 | — |
| layer_14 | BOOLEAN | true | — |
| layer_14_str | FLOAT | 1.00-2–2 | — |
| layer_15 | BOOLEAN | true | — |
| layer_15_str | FLOAT | 1.00-2–2 | — |
| layer_16 | BOOLEAN | true | — |
| layer_16_str | FLOAT | 1.00-2–2 | — |
| layer_17 | BOOLEAN | true | — |
| layer_17_str | FLOAT | 1.00-2–2 | — |
| layer_18 | BOOLEAN | true | — |
| layer_18_str | FLOAT | 1.00-2–2 | — |
| layer_19 | BOOLEAN | true | — |
| layer_19_str | FLOAT | 1.00-2–2 | — |
| layer_20 | BOOLEAN | true | — |
| layer_20_str | FLOAT | 1.00-2–2 | — |
| layer_21 | BOOLEAN | true | — |
| layer_21_str | FLOAT | 1.00-2–2 | — |
| layer_22 | BOOLEAN | true | — |
| layer_22_str | FLOAT | 1.00-2–2 | — |
| layer_23 | BOOLEAN | true | — |
| layer_23_str | FLOAT | 1.00-2–2 | — |
| layer_24 | BOOLEAN | true | — |
| layer_24_str | FLOAT | 1.00-2–2 | — |
| layer_25 | BOOLEAN | true | — |
| layer_25_str | FLOAT | 1.00-2–2 | — |
| layer_26 | BOOLEAN | true | — |
| layer_26_str | FLOAT | 1.00-2–2 | — |
| layer_27 | BOOLEAN | true | — |
| layer_27_str | FLOAT | 1.00-2–2 | — |
| layer_28 | BOOLEAN | true | — |
| layer_28_str | FLOAT | 1.00-2–2 | — |
| layer_29 | BOOLEAN | true | — |
| layer_29_str | FLOAT | 1.00-2–2 | — |
| other | BOOLEAN | true | — |
| other_str | FLOAT | 1.00-2–2 | — |
| save_preset_nameopt | STRING | Enter preset name, then click Save Preset button (or leave for file sync on execute) | |
| delete_preset_nameopt | STRING | Preset to delete (filled automatically by Delete button) | |
| browser_presets_jsonopt | STRING | {} | JSON of all browser presets (auto-filled by JS for sync) |
| save_modelopt | BOOLEAN | false | Save modified model to disk (large files!) |
| save_pathopt | STRING | Directory to save modified model | |
| save_filenameopt | STRING | Filename for saved model (timestamp added) | |
| source_model_pathopt | STRING | Path to original model file (for copying metadata). Required for saved model to load correctly. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| model | MODEL | Model with block modifications applied |
| analysis | STRING | Text analysis of model structure |
| analysis_json | STRING | JSON analysis data |