ComfyUI Node

Boolean OR

The 'run it if anything qualifies' gate

By Stibo·Created 5 months ago·Updated 2 months ago· 9
Boolean OR
    • BOOLEAN
    a
    b

    AND says "only if everything". OR says "run it if anything qualifies." In a workflow that's the difference between "every optional stage is done, go ahead" and "any one of these conditions is met, so do the thing." Boolean OR is the second half of that pairing, and it's just as tiny and just as useful.

    Why you'd want it

    Think of the common "should I even bother" checks: a reference image loaded or a mask provided or the user toggled a fallback on. You don't need all of them - you need at least one, because any one of them makes the downstream step worth running. That's an OR, and two-input OR is exactly what this node gives you: two required boolean inputs, a and b, and one BOOLEAN output that's true if either (or both) is true.

    It slots into the same places every boolean does in this pack - switch selectors, bypass toggles, enabled flags - and it's the natural complement to Boolean AND. Where AND gates expensive steps behind "everything ready," OR gates them behind "anything ready," which is what you want for fallback logic and "try any of these sources" routing.

    The whole thing is part of Nifty Nodes, which is built on the current comfy_api.latest v3 API, so it runs cleanly on the Nodes 2.0 frontend - no legacy shims, no drama.

    The obvious follow-up

    Two inputs will only get you so far. The same pack ships Boolean OR Any, the auto-growing variant that takes up to 16 booleans and returns true if at least one connected input is true. If you're combining three or more conditions, use that one instead of stacking ORs - it's the difference between a readable gate and a pile of nodes that all mean the same thing.

    Mechanism in one line

    output = a or b. That's the entire node. It's deliberately transparent, because the point of logic gates in a visual graph is that you can look at them and know exactly what they do. No hidden settings, no defaults to trip you up - just the gate.

    Install

    Ships in Nifty Nodes for ComfyUI. Manager: search "Nifty Nodes for ComfyUI" → Install → restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Stibo/comfyui-nifty-nodes
    

    Restart ComfyUI afterward. No models, no keys, no per-node dependencies - it's pure Python logic in an MIT-licensed pack that's new enough (v2.1.0, mid-2026) that you'll want to keep it updated.

    Gotchas

    Same one that applies to every boolean in the pack: a true output doesn't force anything to run by itself. OR just computes the value. If you actually want "when this is true, run that branch," wire the output into a switch or bypass node - and prefer the lazy variants, which skip the unused branch entirely, if skipping compute is the goal.

    Categorynifty/logic

    Inputs (2)

    NameTypeDefaultDescription
    aBOOLEANFirst operand.
    bBOOLEANSecond operand.

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN