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

πŸ‘Ύ Boolean

A plain toggle, but sometimes that's exactly what your graph needs

By machinepaintingΒ·Created 10 months agoΒ·Updated 4 months agoΒ· 9
πŸ‘Ύ Boolean
    • boolean
    β—„booleantrueβ–Ί

    This node does exactly one thing: it outputs true or false. That's the whole spec - one boolean toggle input, one BOOLEAN output. If that sounds almost too dumb to ship, remember that ComfyUI's widget model has real gaps: newer core nodes accept a boolean toggle inline, but a huge share of custom nodes only accept a boolean when it arrives on a wire. The Boolean node exists to hand you a value you can wire anywhere, so you stop hunting for which node owns the toggle you care about.

    When you'll actually use it

    The classic setup is a single switch somewhere in your graph that flips the whole behavior of a run - the pack's own Boolean Master Switch or Boolean Switch Value Output are the natural downstream targets, but any node with a BOOLEAN-typed input will take it. Want to toggle a mask's invert without burying yourself in the properties panel of a Mask node? Drop a Boolean, wire it to the invert_mask input, and now it's a visible, labeled switch on your canvas.

    One thing worth knowing

    The node forces re-execution on every queue run (IS_CHANGED returns NaN), which sounds like a bug but is actually intentional: a bare toggle is state, not derived data, and ComfyUI needs to be told to re-run the graph when it flips. Practically it means the node always evaluates - fine for a switch, mildly annoying if you were hoping for caching. Just don't treat it as a cheap "do nothing" placeholder.

    Install

    It ships in MachinePainting Nodes, so install the pack:

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

    or ComfyUI Manager β†’ search "MachinePaintingNodes" β†’ install, then restart ComfyUI. Yes, the whole pack has heavy-ish deps (opencv-python-headless, rembg, numpy<3) for what is, in this node's case, a two-line function. That's the cost of one-pack convenience; if you only ever wanted the utility nodes you're paying for them anyway.

    Troubleshooting

    The only real failure mode is wiring it into an input that isn't BOOLEAN-typed - ComfyUI will refuse the connection, and no amount of toggling fixes that. If the graph looks stuck, verify the target node actually declares a boolean input rather than a float, and remember the pack also ships Boolean Invert if you want the opposite value rather than a second toggle.

    CategoryMachinePaintingNodes/Util

    Inputs (1)

    NameTypeDefaultDescription
    booleanBOOLEANtrueβ€”

    Outputs (1)

    NameTypeDescription
    booleanBOOLEANβ€”