Nodes/ComfyUI LC123 Nodes/LC Boolean Flip
ComfyUI Node

LC Boolean Flip

A one-click NOT gate for your workflow

By lonecatone23·Created 2 months ago·Updated 3 days ago· 18
LC Boolean Flip
    • boolean
    booleanfalse

    Sometimes the logic you want is literally "not that." Enable detailer unless this flag is set. Save the image when a toggle is off. Bypass a node when a condition is false. That's a NOT gate, and while any math or expression node can fake one, a dedicated boolean flip is nicer to read and impossible to wire wrong. LC Boolean Flip is that: one boolean widget in, the exact opposite boolean out, with the tooltip spelling it out - "off→True, on→False."

    The node is a study in minimalism. A single required input, boolean, defaulting to false, and a single BOOLEAN output. There's nothing to configure because there's nothing to configure - the semantics are baked in. The widget is a plain checkbox, and its checked/unchecked state directly becomes the output, inverted. That's the entire node, and that's the point: a NOT gate that can't surprise you.

    Where it earns its keep is in the flow of a real graph. ComfyUI's boolean logic tends to accumulate inversions - a "skip if true" downstream consumer wants the opposite of the "enabled" flag you've been carrying. Slap an LC Boolean Flip in front of it and the flag stays semantically meaningful upstream while the consumer gets the polarity it wants. It also pairs cleanly with the rest of the pack's boolean family: LC Boolean Value emits a source boolean, LC Boolean Switch routes based on one, and LC Boolean Flip is the polarity tool that sits between them. If you find yourself writing "state == false" in a math node just to flip a flag, this is the cleaner expression of the same idea.

    The important sibling distinction, because the pack has both: LC Boolean coerces any value into a true/false without inverting it, while LC Boolean Flip inverts a boolean without coercing. They look similar and do opposite things. Flip takes a real BOOLEAN input and negates it; Boolean takes an int or float and normalizes it. If you feed a number into Flip expecting a clean output, you've grabbed the wrong node - Flip's input is typed boolean, so wire it to a Boolean (or Boolean Value) first.

    There's also the pack's LCInvertBoolean class (listed in the source as a separate node, "Invert Boolean" in the README) which is a near-twin - if both show up in your node menu, they're both just NOT gates, and either does the job.

    The use cases are the boring ones that make up half of graph-building: muting a node when a condition is not met, making a "keep this branch disabled unless something else is true" control, or just cleaning up polarity mismatches between two packs that disagree on what true means. It's not glamorous, but a graph with explicit NOT gates reads a lot better than one with three layers of inverted switches.

    Install is the same LC123 clone:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes
    

    Restart, no pip deps. One checkbox, one inversion, zero surprises - it's the node equivalent of a well-labeled wire.

    CategoryLC123/utils

    Inputs (1)

    NameTypeDefaultDescription
    booleanBOOLEANfalseInverted on output: off→True, on→False.

    Outputs (1)

    NameTypeDescription
    booleanBOOLEAN