ComfyUI Node

not

Flip any boolean, fix any backwards checkbox

By StableLlama·Created about a year ago·Updated about 15 hours ago· 48
not
    • BOOLEAN
    inputfalse

    Every boolean you've ever wanted to flip, this is the node that flips it. not takes a single true/false and returns the opposite - the simplest node in Basic data handling and one of the most frequently needed, because the logic of real workflows is forever "run this unless that." You need NOT constantly, and it's the rare invert node that doesn't ask questions.

    The concrete situation: some node hands you "face detected" when what you actually want is "no face" - a negative condition. Or a checkbox's semantics are backwards for your workflow and you'd rather not rebuild it. Wire the value through not and suddenly the logic reads the way your brain reads it.

    How it works

    One input, one output, pure inversion: not input. True becomes false, false becomes true. That's it - no truth table worth drawing, no edge cases, no coercion. It's the not you remember from every programming language, and because it's Boolean-in/Boolean-out, you can chain it with the pack's and, or, xor, and the comparison nodes without thinking about types.

    The inputs and the output

    • input (BOOLEAN, default False) - the value to invert.
    • BOOLEAN (output) - the opposite of the input.

    That's the whole node. It's the boolean equivalent of a passthrough with a twist, and it composes with everything else in the pack's BOOLEAN category.

    Installing it

    Install Basic data handling from 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 to download.

    Troubleshooting

    • "I need to invert a non-boolean - a number or a string." Don't reach for not directly; Python's truthiness will surprise you (an empty string and a zero are "false-ish," but not "" gives true while not "hello" gives false - and not 3 is false). Cast first with the pack's to BOOLEAN, then invert if you still need to. not is for real booleans.
    • "Double negation reads confusingly." not wired into another not cancels out - it's technically fine, but if you catch yourself doing it, one of the two is redundant. Remove it and the graph gets clearer.
    • "My branch runs when I told it not to." If the value feeding not is unconnected, the default is False and the output is True - so an unconnected not passes "true" downstream, and whatever gate you thought you closed is wide open. Connect something or accept the default deliberately.
    CategoryBasic/BOOLEAN

    Inputs (1)

    NameTypeDefaultDescription
    inputBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN