Nodes/ComfyUI-LBW_flux/LoraBlockWeight_Flux
ComfyUI Node

LoraBlockWeight_Flux

It Doesn't Touch Your LoRA (And That's the Point)

By SS-snap·Created 2 years ago·Updated about a year ago· 5
LoraBlockWeight_Flux
    • block_vector
    layer_or_multi_layer15表示15层权重为0,2-10表示2-10层权重为0

    The name makes it sound like a LoRA loader for Flux. It is not. LoraBlockWeight_Flux doesn't load a LoRA, merge one, or even touch your model - it's a small string generator that produces a block-weight vector for the Inspire Pack's MakeLBW node. Which is exactly what you want when your goal is to zero out parts of a Flux LoRA and see which blocks actually carry the concept.

    Why block weights exist

    "LBW" stands for LoRA Block Weight, a technique that got popular in the Inspire Pack era. Instead of one global LoRA strength, you set per-block weights - amplify some transformer blocks, zero others. On SDXL there was a rough community map of what blocks did what (IN blocks lean style, OUT blocks lean structure). That map died on the trip to Flux. Flux is a 12B rectified-flow transformer (DiT), not a UNet, and the whole notion of a clean "layer" is mushier. The author of this pack says it flat out in the README: layer definitions on a DiT are vague, his test results lack stability, and he suspects systematic block-level rules may not exist. That's refreshingly honest - most custom node READMEs would have invented a fake atlas instead.

    What it actually does

    One input, one output, zero models, zero VRAM. Type 6 or 15-30 (or combine: 2-10,15) into layer_or_multi_layer and it returns a string of 58 numbers - all 1s except the layers you named, which become 0. The code is pure Python: it hardcodes a 58-position list, flips the requested positions to zero, and joins them with commas.

    Those 58 positions map to Flux's transformer blocks - 19 double blocks (D00–D18) and 38 single blocks (S00–S37) - which is the count the Inspire Pack's FLUX-SINGLE-ALL preset expects. Don't ask for a precise mapping of which position is which attention layer; the author doesn't know either, and on a DiT nobody's position is stable enough to matter. The README's "61 blocks minus three" framing is him thinking out loud, not a spec.

    The inputs and outputs that matter

    There's exactly one input and one output, so this is the whole story:

    • layer_or_multi_layer (STRING) - 6 zeroes layer 6; 15-30 zeroes layers 15 through 30; comma-separate to mix: 2-10,15. Ranges are clamped to 1–58 and anything unparseable is silently ignored, so you can't crash it with junk input.
    • block_vector (STRING output) - wire this into the block_vector input on MakeLBW //Inspire. Keep the FLUX-SINGLE-ALL: prefix that MakeLBW already has in its field; this node only supplies the comma-separated part after the colon.

    The full chain from the repo's example workflow: UNETLoaderMakeLBW (takes your LoRA, the vector, and the model) → ApplyLBWModelSamplingFlux → your sampler. MakeLBW builds an LBW_MODEL, ApplyLBW patches it onto the model.

    Installing it

    cd ComfyUI/custom_nodes
    git clone https://github.com/SS-snap/ComfyUI-LBW_flux
    

    Restart ComfyUI. That's the whole install - there's no requirements.txt, no pip dependencies, no model downloads; it's a single stdlib file. ComfyUI Manager can do it too (search the pack title), though for a node this tiny the clone is just as fast.

    The catch: this node is useless alone. You also need ComfyUI-Inspire-Pack installed, or MakeLBW/ApplyLBW don't exist. The repo's example/ folder ships a loop workflow that zeroes each block one at a time - a decent starting template, assuming you already have the usual Flux files (dev fp8, t5xxl fp8, clip_l, ae.safetensors).

    Where people get burned

    • Nothing changes after you zero a block. Expected. If a block contributes little, zeroing it produces no visible difference - that's data, not a bug. Start with aggressive ranges (1-20, 30-58) to find whether a region matters at all, then bisect from there.
    • Type it as a string. The README insists on English (ASCII) input for a reason: paste full-width characters or feed it from a number widget and the parse skips it silently. Write 6, not , not a bare integer from a converter node.
    • Copying someone's full vector. Don't paste a whole FLUX-SINGLE-ALL:... string into layer_or_multi_layer - that input takes layer numbers, and this node generates the vector for you.

    Should you bother?

    Honest verdict: if you just want to run Flux LoRAs normally, this node is not for you - rgthree's Power Lora Loader or the plain LoRA loader does that better. This is for the narrow, fiddly case of characterizing one stubborn LoRA (why does the style bleed through even at low strength? which blocks actually hold the subject?). The author's own caveat stands: you'll likely find patterns within a single LoRA, but don't expect rules that generalize across concepts. For a no-dependency experiment tool that's a perfectly fair trade - and it's one of the few nodes that generates the LBW vector in this format instead of making you hand-count commas.

    CategorySnap Processing

    Inputs (1)

    NameTypeDefaultDescription
    layer_or_multi_layerSTRING15表示15层权重为0,2-10表示2-10层权重为0

    Outputs (1)

    NameTypeDescription
    block_vectorSTRING