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

SDXL Model Layer Editor

Scale the base checkpoint's blocks, not just a LoRA's

By shootthesound·Created 8 months ago·Updated 2 months ago· 538
SDXL Model Layer Editor
  • model
  • model
  • analysis
  • analysis_json
presetDefault
input_0true
input_0_str1.00
input_1true
input_1_str1.00
input_2true
input_2_str1.00
input_3true
input_3_str1.00
input_4true
input_4_str1.00
input_5true
input_5_str1.00
input_6true
input_6_str1.00
input_7true
input_7_str1.00
input_8true
input_8_str1.00
input_9true
input_9_str1.00
input_10true
input_10_str1.00
input_11true
input_11_str1.00
midtrue
mid_str1.00
output_0true
output_0_str1.00
output_1true
output_1_str1.00
output_2true
output_2_str1.00
output_3true
output_3_str1.00
output_4true
output_4_str1.00
output_5true
output_5_str1.00
output_6true
output_6_str1.00
output_7true
output_7_str1.00
output_8true
output_8_str1.00
output_9true
output_9_str1.00
output_10true
output_10_str1.00
output_11true
output_11_str1.00
othertrue
other_str1.00
save_preset_name
delete_preset_name
browser_presets_json{}
save_modelfalse
save_path
save_filename
source_model_path

Most of this pack's block-level tools work on a LoRA's weights. This one works on the SDXL checkpoint itself - scale a UNet block's contribution up or down as an edit to the base model, before any LoRA gets layered on top of it.

What it is and why you'd reach for it

SDXL's UNet has 12 input (encoder) blocks, a mid block, and 12 output (decoder) blocks, and this node gives each one an independent -2 to 2 strength multiplier, with 1.0 meaning unchanged. Because it edits the base model rather than a LoRA, it's the right tool when the thing you want to fix isn't tied to a specific LoRA at all - a checkpoint that's consistently a little too saturated, or a merge that leans too hard into one style, where you want the correction to apply universally rather than being reapplied per-LoRA.

It's one of six model layer editors in ShootTheSound/comfyUI-Realtime-Lora, and the node's own description gives you the same rough block guide the pack uses for its SDXL LoRA-loading nodes: input 0-11 handle structure and composition, the mid block holds high-level features, output 0-5 are the main decoder - with style concentrated around output 1-2 - and output 6-11 handle later, finer detail and texture.

Inputs and outputs that matter

  • model - the SDXL checkpoint to edit.
  • preset - Default, All Off, Half Strength, Outputs Only, Inputs Only, or Custom for hand-tuning.
  • input_0 through input_11, mid, output_0 through output_11, plus other - 26 controls total, each with a toggle and a -2 to 2 strength slider.
  • save_preset_name / delete_preset_name (optional) - save a configuration you like, or delete a saved one.
  • save_model / save_path / save_filename (optional) - write the edited checkpoint to disk as its own .safetensors file.
  • source_model_path (optional) - points the save step at the original checkpoint's location.
  • 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. Works immediately, no extra downloads - model layer editors run out of the box like the rest of the pack's non-training nodes.

Troubleshooting

Zeroed a block hoping for "no contribution" and got noise instead. A strength of exactly 0.0 tends to break a block's residual connection rather than cleanly disable it - stick to roughly 0.5-1.5 for actual adjustments and treat the extremes as deliberate stress-testing, not a normal setting.

Applied a LoRA before this node and the results feel off. Order matters: this is meant to sit upstream of your LoRA loader, editing the base checkpoint so a LoRA applied afterward patches on top of the edited version. Put a LoRA loader before it instead and you're scaling the LoRA's own already-patched weights, not the base model the block guide is describing.

A style edit on output_1 didn't move the needle. That block is the typical strongest style block for SDXL, based on how most fine-tunes distribute their training, but a checkpoint that was itself trained unusually (a heavy merge, or one trained with non-standard settings) can distribute style weight differently. Check analysis after a change rather than assuming the general guide applies to every checkpoint equally.

Categorymodel

Inputs (61)

NameTypeDefaultDescription
modelMODELModel from LoadCheckpoint or LoadDiffusionModel
presetCOMBODefaultQuick preset selection. Individual controls below override when changed.
input_0BOOLEANtrue
input_0_strFLOAT1.00-2–2
input_1BOOLEANtrue
input_1_strFLOAT1.00-2–2
input_2BOOLEANtrue
input_2_strFLOAT1.00-2–2
input_3BOOLEANtrue
input_3_strFLOAT1.00-2–2
input_4BOOLEANtrue
input_4_strFLOAT1.00-2–2
input_5BOOLEANtrue
input_5_strFLOAT1.00-2–2
input_6BOOLEANtrue
input_6_strFLOAT1.00-2–2
input_7BOOLEANtrue
input_7_strFLOAT1.00-2–2
input_8BOOLEANtrue
input_8_strFLOAT1.00-2–2
input_9BOOLEANtrue
input_9_strFLOAT1.00-2–2
input_10BOOLEANtrue
input_10_strFLOAT1.00-2–2
input_11BOOLEANtrue
input_11_strFLOAT1.00-2–2
midBOOLEANtrue
mid_strFLOAT1.00-2–2
output_0BOOLEANtrue
output_0_strFLOAT1.00-2–2
output_1BOOLEANtrue
output_1_strFLOAT1.00-2–2
output_2BOOLEANtrue
output_2_strFLOAT1.00-2–2
output_3BOOLEANtrue
output_3_strFLOAT1.00-2–2
output_4BOOLEANtrue
output_4_strFLOAT1.00-2–2
output_5BOOLEANtrue
output_5_strFLOAT1.00-2–2
output_6BOOLEANtrue
output_6_strFLOAT1.00-2–2
output_7BOOLEANtrue
output_7_strFLOAT1.00-2–2
output_8BOOLEANtrue
output_8_strFLOAT1.00-2–2
output_9BOOLEANtrue
output_9_strFLOAT1.00-2–2
output_10BOOLEANtrue
output_10_strFLOAT1.00-2–2
output_11BOOLEANtrue
output_11_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