ComfyUI Node

NOT

Flip a boolean with one wire

By silveroxides·Created 7 months ago·Updated 3 months ago· 3
NOT
    • BOOLEAN
    input

    NOT is the smallest node in the pack and it does exactly one thing: true becomes false, false becomes true. One boolean in, the opposite boolean out. It's the "invert this flag" node, and while it looks like filler, it's the glue that makes the pack's logic nodes usable in real graphs.

    Why you need an inverter: logic nodes express conditions, and conditions come in both flavors. You might have a node that outputs "image passed the check" but your downstream gate needs "image failed the check" - an AND that should fire when something is not true. Rather than rewire the upstream or build a different comparison, you drop a NOT in the wire. It's also the natural companion to a switch or bypass: invert a "process this" flag to get a "skip this" flag, invert a condition feeding a LogicIF, or negate the output of a MathCompare to flip which branch of a decision gets taken.

    How it works

    One input, input, typed BOOLEAN, and one BOOLEAN output. On execution the node runs Python's not operator: true → false, false → true. Nothing else happens, nothing is transformed, no state is kept. It's about as transparent as a node gets.

    There's exactly one thing to keep in mind, and it's the type: the input is strictly a boolean. If you wire a number or a string into it, you're feeding it something it wasn't built for - the output type is boolean and the conversion path isn't defined the way you might hope. Feed it real booleans, straight from compare nodes, LogicIF outputs, or toggle/switch nodes, and it behaves perfectly.

    The inputs that matter

    • input (boolean) - the value to invert.

    Output is a single BOOLEAN - the logical opposite.

    Install

    This node ships in the ComfyUI-LogicMath pack. Install via ComfyUI Manager (search "ComfyUI-LogicMath", Install, restart) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/silveroxides/ComfyUI-LogicMath
    

    No pip requirements, no model downloads. The pack targets ComfyUI's newer extension API, so if the node doesn't appear after a restart, update ComfyUI first.

    Common issues

    • Input type errors - you fed it a non-boolean. Keep it fed from actual boolean sources.
    • "I wanted the opposite and it's not flipping" - check that the boolean you're inverting is actually the one reaching the input; a stale wire is the usual culprit, not the node.

    NOT is the kind of node you install without thinking about and then reach for constantly once you're building conditional workflows. One wire, one flip, done.

    Categoryutils/logic

    Inputs (1)

    NameTypeDefaultDescription
    inputBOOLEAN

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN