Nodes/NH-Nodes/Boolean Switch (NH)
ComfyUI Node

Boolean Switch (NH)

A plain on/off switch, because your graph needed one

By jetthuangai·Created 5 months ago·Updated 21 days ago· 6
Boolean Switch (NH)
    • boolean
    boolean_switchtrue

    Some nodes are so simple you almost don't need an article about them. Boolean Switch (NH) is one of those - it's a single boolean toggle that outputs the boolean. That's it. One input widget, one BOOLEAN output, no logic inside.

    So why does it exist, and why would you use it instead of the checkbox that ComfyUI already gives you on most boolean inputs? Because the toggle on a node's widget is local to that node. When you want one switch to control three different things across your graph, you have two options: flip three checkboxes every run, or wire them all to one shared boolean.

    How it works

    You get a labeled switch (boolean_switch) rendered as an actual on/off control, and the boolean output carries its state. From there the boolean can drive If/Else (NH), Any Switch (NH), Gate Switch (NH), or any node with a boolean input you've converted to accept a wire (right-click a boolean widget → "Convert to input").

    The genuinely useful pattern is a "mode" switch: one Boolean Switch (NH) at the top of your workflow, fanned out to a gate on the upscale branch and an if/else on the prompt branch. Change one toggle, and the whole graph behaves differently. It's the ComfyUI equivalent of a hardware master switch, and it keeps your "what does this workflow do" decisions in one visible place instead of scattered across twenty checkboxes.

    When it's worth it

    • You have the same condition in more than one place and want a single source of truth.
    • You want a visible, labeled control you can find at a glance in a big graph.
    • You're building a workflow you'll share - one clearly-named toggle beats "remember to uncheck that box over there."

    When it's not worth it: a single boolean that's used in exactly one place. Just use the widget. This node is ceremony for ceremony's sake in that case.

    Installing

    Part of NH-Nodes - install the pack once:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jetthuangai/NH-Nodes.git
    cd NH-Nodes
    pip install -r requirements.txt
    

    Or search NH-Nodes in ComfyUI Manager and restart. No models, no dependencies beyond what ComfyUI already has. There's genuinely nothing else to configure.

    CategoryNH-Nodes/Utils

    Inputs (1)

    NameTypeDefaultDescription
    boolean_switchBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    booleanBOOLEAN