Nodes/TechNodes/SDXL MBW Layers Binary
ComfyUI Node

SDXL MBW Layers Binary

Flip UNet blocks fully on or off, one at a time

By TechnoByteJS·Created 2 years ago·Updated 2 years ago· 14
SDXL MBW Layers Binary
    • MBW_LAYERS
    input_blocks.0false
    input_blocks.1false
    input_blocks.2false
    input_blocks.3false
    input_blocks.4false
    input_blocks.5false
    input_blocks.6false
    input_blocks.7false
    input_blocks.8false
    middle_blocksfalse
    output_blocks.0false
    output_blocks.1false
    output_blocks.2false
    output_blocks.3false
    output_blocks.4false
    output_blocks.5false
    output_blocks.6false
    output_blocks.7false
    output_blocks.8false

    This is the on/off sibling of SDXL MBW Layers. Where that node blends each UNet block by any weight from 0 to 1, this one only offers two states per block - fully from one model or fully from the other, no blend in between. The pack's README is upfront about why these binary variants exist: they make it "easy to extract specific layers," meaning this is a diagnostic node for figuring out where a specific trait lives in the network, not a tool for producing a finished merge in one pass.

    The layout

    The same 19-block shape SDXL MBW Layers uses, just BOOLEAN instead of FLOAT:

    • input_blocks.0 through input_blocks.8 (9 booleans, the encoder side)
    • middle_blocks (1 boolean, the bottleneck)
    • output_blocks.0 through output_blocks.8 (9 booleans, the decoder side)

    All default false. That's not neutral - it behaves like every block being weighted 0 rather than a 50/50 merge, so nothing changes until you start checking boxes.

    Output

    A single MBW_LAYERS, wired the same way as the rest of the pack's MBW nodes - into SDNext Merge's optional_mbw_layers_alpha.

    Why you'd actually reach for the binary version over the float one

    Say a merge partner has a face or a lighting style you want, but pulling it in with a flat alpha also drags in traits you don't want. The float MBW node lets you dial each block down, but you're guessing at fractional weights across 19 sliders with no idea where to start. This node turns that into a bisection problem instead: flip half the blocks on, merge, look. Landed the trait? Narrow to that half. Didn't? Try the other half. A handful of passes narrows a 19-block search space down to the one or two blocks actually responsible - at which point you switch back to the float node and dial in exactly how much of that block you want, rather than the blunt full-on it gives you here.

    Installing it

    ComfyUI Manager: search TechNodes, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TechnoByteJS/ComfyUI-TechNodes --depth 1
    

    No downloads, no dependencies.

    Where people get burned

    Flip more than one block on at a time on your first pass and you lose the ability to attribute the result to any single block - the whole value of this node is isolating one variable, so toggle, merge, generate, compare, and only then move on. It's built for SDXL's 19-block shape specifically; the SD1 MBW Layers Binary sibling handles SD 1.5's 25-block layout, and mixing the two against the wrong architecture won't produce a usable merge. And if what you actually want is a partial blend rather than a hard switch - say, 30% of a block rather than fully off or fully on - that's what the float SDXL MBW Layers node is for; this one deliberately doesn't do gradation.

    CategoryTechNodes/merging

    Inputs (19)

    NameTypeDefaultDescription
    input_blocks.0BOOLEANfalse
    input_blocks.1BOOLEANfalse
    input_blocks.2BOOLEANfalse
    input_blocks.3BOOLEANfalse
    input_blocks.4BOOLEANfalse
    input_blocks.5BOOLEANfalse
    input_blocks.6BOOLEANfalse
    input_blocks.7BOOLEANfalse
    input_blocks.8BOOLEANfalse
    middle_blocksBOOLEANfalse
    output_blocks.0BOOLEANfalse
    output_blocks.1BOOLEANfalse
    output_blocks.2BOOLEANfalse
    output_blocks.3BOOLEANfalse
    output_blocks.4BOOLEANfalse
    output_blocks.5BOOLEANfalse
    output_blocks.6BOOLEANfalse
    output_blocks.7BOOLEANfalse
    output_blocks.8BOOLEANfalse

    Outputs (1)

    NameTypeDescription
    MBW_LAYERSMBW_LAYERS