Nodes/ComfyUI-LoraBlockWeight/LoRA Block Weight (Qwen-Image)
ComfyUI Node

LoRA Block Weight (Qwen-Image)

Per-block LoRA weights for Qwen-Image, one block at a time

By Baldwinzc·Created 4 months ago·Updated 3 months ago· 24
LoRA Block Weight (Qwen-Image)
  • model
  • clip
  • model
  • clip
  • info
lora_name
target_blockB00
target_value1.00
baseline_weight1.00
clip_strength1.00

Qwen-Image is a 20B MMDiT, and like every diffusion transformer it spreads a LoRA's influence across its transformer blocks unevenly. Some blocks carry the style, some carry the character, and some are dead weight that just fight other LoRAs you stack on top. This node lets you dial one of Qwen-Image's 60 blocks at a time - the single-block unit that, paired with Efficiency Nodes' XY Plot, turns "this LoRA is too strong" into a labeled grid of exactly which blocks to trust.

LoRA Block Weight (Qwen-Image) is the FLUX-pack's sweep unit translated to Qwen's layout. Where FLUX.1 splits into 19 double + 38 single blocks, Qwen-Image uses 60 single-stream transformer_blocks with joint image-and-text attention inside each one - tagged B00 through B59. The pack's Qwen demo shows the technique holding up: knocking out the 12 highest-impact blocks stripped a modern-anime LoRA's style back toward photography, while knocking out the 12 lowest did nothing visible. It's a diagnostic microscope, not a one-click enhancer - but it's the tool that tells you a "too strong" LoRA is really "three blocks too strong."

How it works

It's a drop-in LoraLoader replacement. It loads the LoRA, clones the model and CLIP, and applies a per-block strength map by matching LoRA keys against Qwen's real block layout (the transformer_blocks.{N} key structure) so B29 is block 29, not a guess. baseline_weight flips the experiment mode: at 1.0 it's a knock-out sweep (every other block at full, only the target varies - "what breaks when this block is removed?"), and at 0.0 it's a solo sweep (everything else off - "what does this block contribute by itself?"). Non-block layers always follow the baseline; they don't have block indices.

The inputs that matter

  • target_block - B00 to B59. Empty or unknown means no target, everything at baseline. This is what your XY plot will override on the X axis.
  • target_value - the strength for that block, 0 to 2. Your XY plot overrides this on the Y axis.
  • baseline_weight and clip_strength - the knock-out/solo switch, and the LoRA's text-encoder side respectively.

Outputs are the patched model and clip plus an info STRING that reports how many LoRA patches applied and which key (if any) didn't match - the fastest catch for a LoRA that isn't Qwen-Image at all. LoRAs are architecture-bound; an SDXL or FLUX LoRA will load into this node and patch nothing.

Installing it

Via ComfyUI Manager (search LoraBlockWeight) or manually:

cd <ComfyUI>/custom_nodes
git clone https://github.com/Baldwinzc/ComfyUI-LoraBlockWeight.git

Restart, and it appears under the LoraBlockWeight category. No extra Python dependencies and no model downloads - the pack only ships node code.

The workflow that makes it useful

Wire an XY Plot from Efficiency Nodes over this node's target_block and target_value: X = B00,...,B59, Y = 0,0.25,0.5,0.75,1.0, for a 60×5 = 300-image grid. Columns that look identical mean the block doesn't matter; columns where the image changes are your active neighbourhood. If you'd rather skip XY Plot entirely, the pack's Batch node does the same sweep internally - this node is for when you want the plot's extra axes (like seed or prompt) in the same grid.

CategoryLoraBlockWeight

Inputs (7)

NameTypeDefaultDescription
modelMODEL
clipCLIP
lora_nameCOMBO0 options:
target_blockSTRINGB00Block tag: B00..B59. Empty / unknown -> no target, all blocks at baseline_weight.
target_valueFLOAT1.000–2
baseline_weightFLOAT1.000–2Knock-out: 1.0 (others stay full, target varies). Solo: 0.0 (others off, only target varies).
clip_strengthFLOAT1.00-2–2

Outputs (3)

NameTypeDescription
modelMODEL
clipCLIP
infoSTRING