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

Qwen Model Layer Editor

Scale Qwen-Image's 60 blocks before any LoRA sees them

By shootthesound·Created 11 months ago·Updated 2 months ago· 573
Qwen 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►
◄block_40true►
◄block_40_str1.00►
◄block_41true►
◄block_41_str1.00►
◄block_42true►
◄block_42_str1.00►
◄block_43true►
◄block_43_str1.00►
◄block_44true►
◄block_44_str1.00►
◄block_45true►
◄block_45_str1.00►
◄block_46true►
◄block_46_str1.00►
◄block_47true►
◄block_47_str1.00►
◄block_48true►
◄block_48_str1.00►
◄block_49true►
◄block_49_str1.00►
◄block_50true►
◄block_50_str1.00►
◄block_51true►
◄block_51_str1.00►
◄block_52true►
◄block_52_str1.00►
◄block_53true►
◄block_53_str1.00►
◄block_54true►
◄block_54_str1.00►
◄block_55true►
◄block_55_str1.00►
◄block_56true►
◄block_56_str1.00►
◄block_57true►
◄block_57_str1.00►
◄block_58true►
◄block_58_str1.00►
◄block_59true►
◄block_59_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 the Qwen-Image checkpoint itself, block by block, before anything else touches it - not a LoRA's weights, the base model's. If a particular block is consistently pushing your output toward a color cast or a composition habit you don't want, you scale that block down here and every LoRA and every prompt afterward inherits the fix.

What it is and why you'd reach for it

Qwen-Image's DiT has 60 blocks, and this node gives each one an independent strength multiplier from -2 to 2, with 1.0 as unchanged. The distinction that matters is base model editing versus the pack's LoRA-focused selective loaders: this happens upstream, so a LoRA you apply afterward is patching your already-adjusted model rather than the two fighting for the same territory. It's the coarse, per-block sibling of a finer control scheme - this pack doesn't ship a Qwen sub-component debiaser the way it does for Z-Image and Flux Klein, so block-level is currently the deepest control available for Qwen's base model specifically.

How it works

Unlike Z-Image's layer editor, which the pack documents with named zones (early/mid/late), the Qwen version's node description doesn't spell out block-by-block roles the same way - you're working from the analysis output and experimentation rather than a pre-written map. The preset options give you a starting shortcut (Late Only 45-59, Half Strength) that at least matches the general pattern seen elsewhere in this pack's architecture coverage, where later blocks tend to carry more fine-detail influence and earlier ones more structural.

Inputs and outputs that matter

  • model - the Qwen-Image checkpoint to edit.
  • preset - Default, All Off, Half Strength, Late Only (45-59), or Custom.
  • block_0 through block_59, each with a toggle and a -2 to 2 strength slider, plus other for weights outside the 60 numbered blocks.
  • save_preset_name / delete_preset_name (optional) - name and save a toggle configuration you like, or remove a saved one.
  • save_model / save_path / save_filename (optional) - export the edited checkpoint as a new .safetensors file.
  • source_model_path (optional) - points the save operation at the original model's location.
  • Outputs: model (patched, feed to your sampler or a LoRA loader downstream), analysis (text summary of what's applied), analysis_json (structured data for chaining to another node).

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 additional install for model layer editors, same as the pack's loaders and analyzers.

Troubleshooting

Zeroed a block hoping for "no effect" and got artifacts instead. A strength of exactly 0.0 is a much bigger disruption to the model than a subtle scale-down - the pack's sibling debiaser nodes state this explicitly for the finer sub-component controls, and the same logic applies at block level here. Stay in roughly the 0.5-1.5 range unless you're deliberately stress-testing.

Applied this after a LoRA loader and results got unpredictable. This node is meant to sit upstream of any LoRA - editing the base checkpoint, then letting a LoRA patch on top of your edited version. Put it after a LoRA loader instead and you're scaling the LoRA's own contribution unevenly, which isn't what the block guide (or your intuition about what each block does) is built around.

Saved a preset but it's gone next session. Presets save via save_preset_name, but double-check the save actually completed - if browser_presets_json isn't being persisted by your ComfyUI setup (some multi-user or containerized deployments reset browser-local state between sessions), the preset only exists for that session's node instance.

Categorymodel

Inputs (131)

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—
block_40BOOLEANtrue—
block_40_strFLOAT1.00-2–2—
block_41BOOLEANtrue—
block_41_strFLOAT1.00-2–2—
block_42BOOLEANtrue—
block_42_strFLOAT1.00-2–2—
block_43BOOLEANtrue—
block_43_strFLOAT1.00-2–2—
block_44BOOLEANtrue—
block_44_strFLOAT1.00-2–2—
block_45BOOLEANtrue—
block_45_strFLOAT1.00-2–2—
block_46BOOLEANtrue—
block_46_strFLOAT1.00-2–2—
block_47BOOLEANtrue—
block_47_strFLOAT1.00-2–2—
block_48BOOLEANtrue—
block_48_strFLOAT1.00-2–2—
block_49BOOLEANtrue—
block_49_strFLOAT1.00-2–2—
block_50BOOLEANtrue—
block_50_strFLOAT1.00-2–2—
block_51BOOLEANtrue—
block_51_strFLOAT1.00-2–2—
block_52BOOLEANtrue—
block_52_strFLOAT1.00-2–2—
block_53BOOLEANtrue—
block_53_strFLOAT1.00-2–2—
block_54BOOLEANtrue—
block_54_strFLOAT1.00-2–2—
block_55BOOLEANtrue—
block_55_strFLOAT1.00-2–2—
block_56BOOLEANtrue—
block_56_strFLOAT1.00-2–2—
block_57BOOLEANtrue—
block_57_strFLOAT1.00-2–2—
block_58BOOLEANtrue—
block_58_strFLOAT1.00-2–2—
block_59BOOLEANtrue—
block_59_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