ComfyUI Node

Nor

The 'neither of these' gate

By marco-zanella·Created about a year ago·Updated about a year ago· 0
Nor
    • nor
    firsttrue
    secondtrue

    Nor is the strictest gate in the set: it returns true only when neither input is true. Where Or says "any of these," Nor says "none of these." It's the boolean you reach for when a workflow should take the special path only if no trigger is active - a clean "do nothing unless told otherwise" condition that's surprisingly rare to find spelled out as a single node.

    It's part of marco-zanella's ComfyUI-BooleanExpression pack, a dependency-free logic collection that ships the full gate set (And, Or, Xor, Nand, Nor) so you don't have to staple a Not onto an Or. Nor is literally not (first or second) - Or's permissiveness, negated.

    How it works

    Two required inputs, both BOOLEAN and both defaulting to true:

    • first - the first boolean value
    • second - the second boolean value

    Output is nor, a BOOLEAN: not (first or second). One line of Python. Truth table: false, false, false, true - the only passing case is when both inputs are false.

    The natural use: "if neither condition applies, fall through." Two comparison checks - "is it high-res?" and "is the batch big?" - feed a Nor, and the output is true only for the plain, default case. Pipe that into a Conditional Branch and you've got "keep it simple unless there's a reason not to." It's the polite, default-respecting gate.

    Installing it

    No models, no dependencies, pure Python - the pack's requirements.txt is empty. ComfyUI Manager, search ComfyUI-BooleanExpression, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/marco-zanella/ComfyUI-BooleanExpression.git
    

    Restart ComfyUI, and it's under Boolean Expressions.

    Gotchas

    • The defaults bite in reverse. Both inputs default to true, and not (true or true) is false - so a fresh Nor node is off until you wire real values in. If your workflow "doesn't do the default thing" after adding a Nor, this is why.
    • Nor is not Or. The names rhyme and the shapes match, but the truth tables are opposites. If a branch flips behavior, check you didn't grab the wrong gate - it's the single most common mix-up in this family.
    • It selects a value, not a path. Like every gate here, Nor just produces a boolean; both input chains of any downstream Conditional Branch still compute. Free for booleans.
    • Juggling multiple gates? Binary Expression in the same pack collapses and/or/xor/nand/nor into one dropdown. Dedicated nodes read better in shared workflows; the dropdown wins for tinkering.

    Nor is the least-loved gate in the pack, and honestly it's fine - most workflows never need "none of these." But when you're building a careful default-first workflow, it's the node that says exactly what you mean in one word.

    CategoryBoolean Expressions

    Inputs (2)

    NameTypeDefaultDescription
    firstBOOLEANtrueThe first boolean value.
    secondBOOLEANtrueThe second boolean value.

    Outputs (1)

    NameTypeDescription
    norBOOLEAN