Nodes/ComfyUI Inspire Pack/LoRA Loader (Block Weight)
ComfyUI Node Runs on cloud

LoRA Loader (Block Weight)

Turn a LoRA's layers up and down, not just its strength

By ltdrdata·Created 3 years ago·Updated 9 months ago· 805
LoRA Loader (Block Weight)
  • model
  • clip
  • model
  • clip
  • populated_vector
category_filter
lora_name
strength_model1.00
strength_clip1.00
inversefalse
seed0
A4.00
B1.00
preset
block_vector1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1
bypassfalse

A normal LoRA loader gives you one dial: strength. This one gives you seventeen. Instead of applying the whole LoRA at one weight, you set a per-block weight vector so some layers of the LoRA fire at full strength and others get turned down or off entirely. That's the whole idea, and it's more useful than it sounds.

Here's why you'd want it. A LoRA isn't one thing - it's a patch spread across a checkpoint's attention layers, and different layers carry different jobs. The early (input) blocks tend to hold composition and pose; the middle blocks hold a lot of the subject; the later (output) blocks carry style and fine detail. When you load a character LoRA and it also drags in the exact pose and framing it was trained on, that's the composition blocks talking. Block weight lets you zero those out and keep just the face, or keep just the style and drop everything else. It's the ComfyUI answer to hako-mikan's well-known sd-webui-lora-block-weight extension, which is where the whole technique and its syntax came from.

How it works

The block_vector is a comma-separated list of multipliers, one per block (the default 1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1 is an SD-style layout). You can drop in the preset dropdown instead - it's got 42 named vectors like SD-INS (input blocks only), SD-MIDD (middle), and SD-OUTS (output), which are the standard starting points. The values aren't limited to plain numbers: R picks a random 0/1 per block from the seed, and A/B slot in the values of the A and B inputs (with a/b being half of each), which is handy for sweeping a value across several blocks at once. Whatever it resolves to comes back out on populated_vector so you can see exactly what ran.

On top of the vector, strength_model and strength_clip are the usual global LoRA strengths - the block weights multiply against those.

The inputs and outputs that matter

  • lora_name - the LoRA to load. If the dropdown's empty, you've got no files in models/loras.
  • block_vector / preset - the per-block weights. Start from a preset, then edit.
  • A, B, seed - only matter if your vector uses A, B, or R.

Outputs are model and clip (patched, wire them onward exactly like any LoRA loader) plus populated_vector, the resolved string.

Installing it

Easiest path is ComfyUI Manager: search "Inspire Pack", install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack

Then restart ComfyUI. The pack has a requirements.txt (Manager runs it for you; manual installers should pip install -r requirements.txt in the ComfyUI Python env). It's by Dr.Lt.Data - the same person behind ComfyUI Manager and the Impact Pack - so it's well-maintained and not going anywhere.

Where people get tripped up

The block layout is architecture-specific. Those SD- presets are built for the SD 1.5 / SDXL block count, and a Flux or other newer-architecture LoRA has a different number of blocks, so the presets won't map cleanly - you'll be editing the vector by hand. The bigger honest issue: knowing which block does what for your LoRA is trial and error. Nobody memorizes it. That's exactly what the companion XY Input: LoRA Block Weight node exists for - sweep a bunch of preset vectors, generate the grid, and read off which blocks actually change the picture. Do that once and this node stops being guesswork.

CategoryInspirePack/LoraBlockWeight

Inputs (13)

NameTypeDefaultDescription
modelMODEL
clipCLIP
category_filterCOMBO1 options: All
lora_nameCOMBO0 options:
strength_modelFLOAT1.00-10–10
strength_clipFLOAT1.00-10–10
inverseBOOLEANfalseApply the following weights for each block: True: 1 - weight False: weight
seedINT00–18446744073709550000
AFLOAT4.00-10–10
BFLOAT1.00-10–10
presetCOMBO42 options: Preset, SD-NONE:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, SD-ALL:1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, SD-INS:1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0, SD-IND:1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0, SD-INALL:1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0, +36
block_vectorSTRING1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1
bypassBOOLEANfalse

Outputs (3)

NameTypeDescription
modelMODEL
clipCLIP
populated_vectorSTRING