Nodes/MachinePainting Nodes/πŸ‘Ύ Boolean Master Switch
ComfyUI Node

πŸ‘Ύ Boolean Master Switch

One toggle to rule all the toggles

By machinepaintingΒ·Created 10 months agoΒ·Updated 4 months agoΒ· 9
πŸ‘Ύ Boolean Master Switch
    • out_1
    β—„mastertrueβ–Ί

    Every serious workflow ends up with the same problem: six nodes, each with its own boolean toggle, and you have to flip them all by hand when you switch between "final render" and "test pass." Boolean Master Switch is the fix - a single master toggle whose value fans out to multiple targets, so one click flips them all. If you've ever wanted a "kill switch" for half your graph, this is it.

    How the fan-out works

    The node itself is almost embarrassingly simple: one required master input (a boolean, default true), and a single output called out_1. The trick is that the output is declared as a list (OUTPUT_IS_LIST with a max length of 25), so ComfyUI lets you connect that one output jack to many downstream boolean inputs at once. You toggle master, and every node wired to out_1 sees the same value on the next run.

    What you'd wire it to

    The natural targets are the pack's own boolean consumers - invert_mask toggles on the mask and color nodes, Boolean Switch Value Output if you want the master state to select a number, or a run of the switch nodes. But honestly the most useful habit is to wire it to a batch of mask-invert or strength-enable toggles across your graph so a whole "mood" switches together. It's the utility-node equivalent of a hardware power strip: unglamorous, but you'll miss it the moment it's not there.

    Why a list output instead of ten jacks

    You might reasonably ask why it doesn't just have ten labeled boolean outputs. The list-output design means the node stays tiny on the canvas, and you connect exactly as many targets as you need - no fixed wiring, no dead ports. Downside: because it's one list output, you can't give each downstream branch a different value. If you need true/false and its inverse, chain a Boolean Invert off it. That's the one pattern this node can't do alone.

    Install

    Same pack, same drill:

    cd ComfyUI/custom_nodes
    git clone https://github.com/machinepainting/ComfyUI-MachinePaintingNodes.git
    pip install -r requirements.txt
    

    Or ComfyUI Manager β†’ "MachinePaintingNodes" β†’ install β†’ restart.

    Troubleshooting

    The node always re-runs (IS_CHANGED returns NaN), so a flipped master will propagate even if nothing else in the graph changed - that's what you want. The one thing that trips people up is the list output: if you're dragging from out_1 and ComfyUI complains the connection is "unexpected type," double-check the downstream input is actually BOOLEAN-typed, not FLOAT. And remember the 25-target ceiling; if you're fanning out to more than that, you're probably doing something only a spreadsheet could love anyway.

    CategoryMachinePaintingNodes/Util

    Inputs (1)

    NameTypeDefaultDescription
    masterBOOLEANtrueβ€”

    Outputs (1)

    NameTypeDescription
    out_1BOOLEANβ€”