ComfyUI Node

nor

The strictest gate in the boolean family — true only when all is false

By StableLlama·Created about a year ago·Updated about 15 hours ago· 48
nor
    • BOOLEAN
    input1false
    input2false

    nor is the strictest gate in the boolean family, and also the one you'll use least. It returns true in exactly one situation: both inputs are false. Any other combination - one true, or both true - and it says false. In Python terms it's not (input1 or input2), which is where it gets its name: NOR = negated OR.

    It's part of Basic data handling, StableLlama's zero-dependency pack, and like its sibling NAND it's mostly there to complete the logic set rather than to star in anyone's workflow. The genuinely useful framing: NOR is "none of these conditions are met." If you have two failure flags and you want to act only when neither is set, NOR is literally that gate. You could build it from or + not, and for readability you often should - but when the "neither of these" reading is exactly what you mean, a single NOR expresses it without you having to name two intermediate nodes.

    How it works

    Both inputs are BOOLEAN. The truth table is the small one: both false → true; otherwise → false. Because it's a negated OR, it's the mirror image of NAND - NAND is true in three of four cases, NOR is true in only one. If you mix the two up, remember: NOR is the one that's "no for yes," true only in the all-false corner.

    The inputs and the output

    • input1 (BOOLEAN, default False)
    • input2 (BOOLEAN, default False)
    • BOOLEAN (output) - true only when both inputs are false.

    Same socket layout as every other two-input boolean node, so it drops into the same wiring patterns.

    Installing it

    Install Basic data handling via ComfyUI Manager (search "Basic data handling"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
    

    Restart ComfyUI. No dependencies, no models.

    Troubleshooting

    • "It's false and I expected true." With NOR, that means at least one input is true - exactly the opposite of what AND would tell you. Double-check which gate you actually placed, and remember the unconnected-input default is False (which, for NOR, makes an unconnected input true on the output). If you left both inputs unconnected, the node happily outputs true forever.
    • "I wanted 'not both'." That's NAND. NOR and NAND are the two most commonly flipped gates - NOR is the one true only when everything's false.
    • "I want to act when none of three conditions are met." NOR only takes two inputs. Chain two NORs, or use the or + not route. Both work; the chain reads a little better.
    CategoryBasic/BOOLEAN

    Inputs (2)

    NameTypeDefaultDescription
    input1BOOLEANfalse
    input2BOOLEANfalse

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN