ComfyUI Node

Not

Flip a boolean inline

By mirabarukaso·Created 2 years ago·Updated 5 days ago· 206
Not
    • not_bool
    • result
    booltrue

    Not is the simplest logic gate there is: True in, False out; False in, True out. That's the entire node. It exists because sometimes you've got a boolean coming from somewhere - a switch, an even/odd check, a toggle upstream - and you need the opposite of it to drive a second node, without going back and re-wiring or duplicating the switch.

    It's part of ComfyUI_Mira, mirabarukaso's grab-bag of small logic and workflow-glue nodes, and it fits the pack's whole personality: tiny, single-purpose, meant to keep a graph readable. In the author's regional-conditioning and switching workflows you often have one control boolean that should turn one branch on and another off - feed the raw boolean to the first and its inversion (via this node) to the second, and a single toggle now drives both correctly.

    How it works

    It applies a logical NOT to the input boolean and outputs the flipped value. It also hands you a STRING version of the result, so you can wire the word "True"/"False" into a text display, a note, or anything that shows you the state at a glance. No config, no edge cases - it's a NOT gate.

    The inputs and outputs that matter

    • bool - the boolean to invert (default True).
    • not_bool (output) - the inverted BOOLEAN, into your next switch or gate.
    • result (output) - the same result as a STRING, handy for a text/preview node so you can eyeball the state.

    Installing it

    ComfyUI Manager: search ComfyUI_Mira, install, restart. Or clone:

    cd ComfyUI/custom_nodes && git clone https://github.com/mirabarukaso/ComfyUI_Mira.git
    

    then restart. If it errors on load, run pip install -r requirements.txt in the ComfyUI_Mira folder. It's under Mira/Logic.

    Common issues

    • Don't add it where you don't need it. If you control the source toggle directly, just flip that instead of adding a NOT downstream. The node earns its keep when one boolean has to drive two branches in opposite directions, or when the boolean comes from a node you can't re-configure.
    • String vs. boolean. The result output is text for display only - wire not_bool (the actual BOOLEAN) into logic sockets, and result into text nodes. Feeding the string into a boolean input won't behave.
    • It's genuinely trivial. There's no hidden behavior here to trip on. If a switch downstream is doing the opposite of what you expect, the wiring is the thing to check, not this node.
    • Personal-pack caveat. Mira is one developer's toolkit and menu placement has shifted across updates; if the node loads red in an old workflow, it just means the pack needs installing or updating through Manager. A NOT gate isn't going to change behavior on you - reconnect it and move on.
    CategoryMira/Logic

    Inputs (1)

    NameTypeDefaultDescription
    boolBOOLEANtrue

    Outputs (2)

    NameTypeDescription
    not_boolBOOLEAN
    resultSTRING