Nodes/ComfyUI-Krea2-strip-layers/Load LoRA Advanced (Krea2 Strip Layers)
ComfyUI Node

Load LoRA Advanced (Krea2 Strip Layers)

Per-block weights instead of all-or-nothing

By Brioch·Created 2 months ago·Updated 2 months ago· 9
Load LoRA Advanced (Krea2 Strip Layers)
  • model
  • MODEL
lora_name
strength_model1.00
strip_all_blockstrue
use_block_selectionfalse
block_selection0-27
use_block_weightsfalse
block_weights1
strip_first_lasttrue
strip_time_mlptrue
strip_txtfusion_layerwisefalse
strip_txtfusion_projectorfalse
strip_txtfusion_refinerfalse

The simple Load LoRA (Krea2 Strip Layers) node is a hammer: strip the whole transformer stack or don't. Load LoRA Advanced is the scalpel. Same family, same trick - filter the LoRA's state dict by key prefix before applying it - but instead of all-or-nothing, you get per-block selection and per-block weighting, on top of the same txtfusion and time-MLP strip toggles. If you've got an NSFW Krea2 LoRA that overpowers a character LoRA and you want only some of its blocks, this is the one you reach for.

Why it exists

Krea 2's open weights shipped with refusal behavior trained in, and the community workaround is bypass/uncensor LoRAs - but drop one of those on a character LoRA and the two slug it out. The strip-layers approach (originally from Puppet_Master's "NSFW Krea2 Low VRAM" LoRA, which this pack generalizes) lets you keep a few blocks of an NSFW LoRA so it blends with your character instead of trampling it. The README's example: to keep only the first 8 blocks, strip its complement.

The inputs that matter

You still get the shared stuff - model, lora_name, strength_model (the global multiplier that per-block weights scale against), and the strip toggles strip_first_last, strip_time_mlp, and the strip_txtfusion_* trio. Then the block controls, which have a strict precedence: use_block_weights beats use_block_selection, which beats strip_all_blocks.

  • strip_all_blocks (default on) - the all-or-nothing fallback. Ignored once either of the other two is on.
  • use_block_selection + block_selection - strip only the listed blocks. A Krea2 model has 28 blocks, 027. The gotcha: the field lists blocks to remove, so "keep only the first 8" is written 8-27, not 0-7. Empty = strip none. Format is ranges and lists like 0-27, 10-27, 5,8,20-27.
  • use_block_weights + block_weights - the interesting one. Instead of stripping, each block's contribution is scaled by strength_model × block_weight, so 1.0 = full, 0.5 = half, 0 = off. Three forms: a single value (0.5 = every block at half), a positional list (1,1,0.5,0 = blocks 0-3, rest default 1.0), or labeled overrides (12:0.5,20:0 = only those blocks change). Negative weights are allowed.

How the weighting actually works

Per-block weight mode doesn't strip anything. It buckets the LoRA's keys by effective weight, then applies one ComfyUI LoRA patch per distinct weight via comfy.lora.load_lora + add_patches. That matters because it means any format - LoRA, LoKr, LoHa - gets reconstructed correctly rather than having rank math broken by partial removal. A weight of exactly 0 drops those blocks' keys entirely, which is functionally identical to stripping them. The non-block groups (txtfusion, first/last, time-MLP) keep obeying their strip toggles no matter which block mode you're in.

Using it

Drop it in where you'd put any LoRA loader: MODEL from your UNETLoader in, MODEL out to the sampler. Example flow for keeping character likeness while borrowing an NSFW LoRA's capability: turn on use_block_weights, leave the defaults alone otherwise, and start with something conservative like 1,1,0.5,0 - then nudge individual blocks with labeled overrides. Malformed specs are logged as warnings and silently ignored, so read the console if a setting seems to do nothing.

Installing it

Identical to the simple node - it ships in the same pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Brioch/ComfyUI-Krea2-strip-layers

Restart ComfyUI and both nodes appear under loaders/krea2. Or use ComfyUI Manager and search "Krea2 strip layers". No pip dependencies, no model downloads; the pack's standalone tools/strip_lora.py CLI (for baking a stripped file to disk) wants safetensors, which your ComfyUI env already has.

Where people get burned

The block-selection list being a remove list trips up everyone - typing 0-7 to "keep the first 8" strips the first 8 and keeps the rest, the exact opposite of intent. And the same "0 keys removed" console warning from the simple node applies here: if nothing matched, you're applying the unstripped LoRA, likely because it isn't actually a Krea2 LoRA. Finally, strip_first_last and strip_time_mlp only match the diffusion_model. key convention, so on a diffusers-format LoRA those two toggles are no-ops - block stripping and the txtfusion toggles work on both. Start with block_selection, iterate toward weights; that's the path that costs you the least hair.

Categoryloaders/krea2

Inputs (13)

NameTypeDefaultDescription
modelMODELThe diffusion model the LoRA is applied to.
lora_nameCOMBOThe Krea2 LoRA to strip and apply.
strength_modelFLOAT1.00-100–100Global LoRA strength. Per-block weights (if enabled) multiply this.
strip_all_blocksBOOLEANtrueStrip ALL transformer blocks. Ignored when use_block_selection or use_block_weights is ON.
use_block_selectionBOOLEANfalseStrip only the blocks listed in block_selection (ignores strip_all_blocks). Ignored when use_block_weights is ON.
block_selectionSTRING0-27Blocks to strip when use_block_selection is ON. Range/list like '0-27', '10-27', '5,8,20-27'. Empty = strip none.
use_block_weightsBOOLEANfalsePer-block weight mode: scale each block by block_weights instead of stripping (weight 0 = off). Overrides the block strip toggles above.
block_weightsSTRING1Per-block weights. '1'=all x1; '1,1,0.5,0'=positional (block 0 first, rest 1.0); '12:0.5,20:0'=only listed blocks changed.
strip_first_lastBOOLEANtrueStrip DiT input/output layers: first, last_linear, last.linear
strip_time_mlpBOOLEANtrueStrip time MLP / timestep projection: tmlp_, tproj_1
strip_txtfusion_layerwiseBOOLEANfalseStrip txtfusion layerwise blocks (full censor).
strip_txtfusion_projectorBOOLEANfalseStrip txtfusion projector (zero impact).
strip_txtfusion_refinerBOOLEANfalseStrip txtfusion refiner (tiny impact / full censor).

Outputs (1)

NameTypeDescription
MODELMODELThe model with the (stripped / weighted) LoRA applied.