Nodes/ComfyUI JMNodes/Binary Not JM
ComfyUI Node

Binary Not JM

The One-Node Fix for Negative Prompts in Combinatorial Workflows

By JustinMatters·Created 2 years ago·Updated 2 years ago· 0
Binary Not JM
    • BOOLEAN
    boolean_inputfalse

    Binary Not JM is the smallest node in the pack and the one that does exactly one thing: it flips a boolean. True goes in, False comes out. That's the whole job, and on its own it looks pointless - you can flip a toggle in the UI yourself. But in a combinatorial workflow it earns its place, because the point of those workflows is that you don't toggle anything by hand. The switches are driven by bits of a counter, and the negative prompt needs the mirror image of those bits.

    Here's the setup it exists for. In the JMNodes pattern you build a positive prompt from fragments that get gated on or off by the bits of a running integer. The negative prompt should be the exact opposite: when "snow on the ground" is in the positive, its exclusion phrase should come out of the negative. When the bit says the fragment is off, the negative's version should be off too. "Inverted bit" is precisely a NOT. So you take each boolean output from Integer to Boolean Values JM, run it through a Binary Not JM, and feed that to the gate controlling the matching negative-prompt fragment. The positives and negatives stay locked together across all 1024 combinations without you touching anything.

    How it works

    There is no subtlety here - the source is if boolean_input: return (False,) else: return (True,). It's a boolean NOT gate rendered as a ComfyUI node. That's the entire mechanism, and it's exactly as trustworthy as that sounds. Zero dependencies, zero state, zero chance of a surprise.

    The input and output

    • boolean_input - BOOLEAN, default False. The value you want inverted.
    • BOOLEAN - the inversion. One output, no optional inputs, no lists.

    Wire it between the boolean outputs of Integer to Boolean Values JM (or any boolean source) and the boolean_switch input of a Switchable Prompt JM that's handling a negative-prompt fragment. The pack's example workflow chains it exactly that way: three Binary Not nodes inverting three bits for a three-fragment negative prompt.

    Installing it

    It's part of ComfyUI JMNodes (JustinMatters/comfyUI-JMNodes), the same small four-node pack as Integer to Boolean Values JM. Install via ComfyUI Manager (search "JMNodes") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JustinMatters/comfyUI-JMNodes
    

    Restart ComfyUI. No requirements.txt, no models, nothing heavy - it's a Python not statement with a nicer wrapper. You can't misinstall a node this trivial.

    Common issues

    Honestly, about the only way to get confused here is to feed it the wrong boolean or forget which side you've inverted. A False default plus a mirror-image wiring is a recipe for "my negative is the empty string" moments, but that's a graph-logic mistake, not a node failure. If your negatives are coming out backward, check the whole inversion chain rather than the node itself - it's the one component that can't be wrong. Worth noting the pack as a whole is quiet: released in one go in early 2025, no updates since, which for a logic gate is the right amount of maintenance.

    CategoryJMNodes

    Inputs (1)

    NameTypeDefaultDescription
    boolean_inputBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN