Nodes/ComfyUI-LoRA-Block-Filter/Flux LoRA Block Weight
ComfyUI Node

Flux LoRA Block Weight

Tell a Flux LoRA which blocks it's allowed to touch

By DanrisiUA·Created 4 months ago·Updated 3 months ago· 36
Flux LoRA Block Weight
    • block_weights
    presetall_enabled
    img_attn1.00
    img_mlp1.00
    txt_attn1.00
    txt_mlp1.00
    single_linear1.00
    double_block_vector1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
    single_block_vector1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0

    Flux LoRAs are a blunt instrument: you get one strength slider and the whole 12B transformer reacts. If your Flux style LoRA keeps dragging the wrong look in, or your subject LoRA is fighting the checkpoint's own behavior, the fix isn't a lower strength - it's deciding which blocks the LoRA gets to influence. That's what Flux LoRA Block Weight is for.

    This is the control-panel half of the ComfyUI-LoRA-Block-Filter pack (by Danrisi, the person behind Anima's "UltraReal" realism fine-tunes). It doesn't load anything itself - it's a pure configuration node that builds a set of weights and hands them to its sibling, Flux LoRA Filter (Blocks), which does the actual loading and patching. Think of this node as the sliders and the other one as the application.

    The mental model

    Flux is a 12B rectified-flow transformer with 8 double blocks (where image and text tokens are processed together) and 24 single blocks (image tokens alone). Each double block has four relevant layer types - img_attn, img_mlp, txt_attn, txt_mlp - and the single blocks have single_linear. The img-versus-txt split is the heart of why block weighting matters on Flux: text-conditioning layers are where prompt/style influence concentrates, and image layers are where the subject's features get pinned down. Dampen the text blocks and a style-heavy LoRA leaks less; kill the image blocks and you lose the subject.

    Inputs

    • preset - the quick win, with ten options: all_enabled, character_detail, no_style_leak, face_focused, style_transfer, plus architecture-level cuts (double_only, single_only, img_only, txt_only) and custom. The no_style_leak preset zeroes txt_attn and txt_mlp while leaving image blocks mostly intact - that's the one people reach for first.
    • img_attn, img_mlp, txt_attn, txt_mlp, single_linear - per-layer-type weights, 0 to 2 in 0.05 steps. These apply to every block of that type.
    • double_block_vector - 8 comma-separated multipliers, one per double block. Default is all 1.0.
    • single_block_vector - 24 comma-separated multipliers, one per single block.

    So you get two levels of control: coarse (layer type) and fine (individual block). Want the last few single blocks untouched? Put a 0.0 in positions 21-24 of the single vector. The vectors are multiline text fields, so they're a bit fiddly to eyeball, but the fine-grained control is what makes this pack different from a plain strength multiplier.

    Output

    A single block_weights output of type FLUX_BLOCK_WEIGHTS, which wires into the block_weights input on Flux LoRA Filter (Blocks). That's the whole job - no model passes through this node.

    Install

    ComfyUI Manager can install it by searching the pack title, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DanrisiUA/ComfyUI-LoRA-Block-Filter
    

    Restart ComfyUI; nodes live under Smart LoRA. No requirements.txt, no model downloads - the pack only uses ComfyUI's own LoRA machinery, which is refreshing in a world of custom nodes that drag in half of PyPI.

    Honest caveats

    Presets are a starting point, not a solution. "Character detail" versus "no style leak" is a real distinction in the weights, but the right numbers depend on your specific LoRA and prompt - treat them as a sane default and then nudge the layer weights. If a LoRA's keys don't use standard Flux naming (double_blocks.N.* / single_blocks.N.*), the filter won't match them and everything passes at full strength; the info output on the filter will tell you if nothing got filtered.

    CategorySmart LoRA

    Inputs (8)

    NameTypeDefaultDescription
    presetCOMBOall_enabled10 options: all_enabled, character_detail, no_style_leak, face_focused, style_transfer, double_only, +4
    img_attnFLOAT1.000–2
    img_mlpFLOAT1.000–2
    txt_attnFLOAT1.000–2
    txt_mlpFLOAT1.000–2
    single_linearFLOAT1.000–2
    double_block_vectorSTRING1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
    single_block_vectorSTRING1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0

    Outputs (1)

    NameTypeDescription
    block_weightsFLUX_BLOCK_WEIGHTS