Nodes/ComfyUI-JakeUpgrade/Bool Binary Operation JK๐Ÿ‰
ComfyUI Node

Bool Binary Operation JK๐Ÿ‰

Every boolean gate in one dropdown

By jakechaiยทCreated 2 years agoยทUpdated 3 months agoยท 146
Bool Binary Operation JK๐Ÿ‰
    • BOOLEAN
    โ—„opโ–พโ–บ
    โ—„afalseโ–บ
    โ—„bfalseโ–บ

    If the dedicated Bool Binary And/Or nodes are the "keep it simple" path, CM_BoolBinaryOperation is the full toolbox: one node, one dropdown, eight boolean operations on two inputs. It's the node that replaced the old generic bool operation in JakeUpgrade (which shipped defaulting to OR and caused a wave of "why is my AND not working" confusion), rewritten in v2.2.0 with proper tooltips and a clear operation list.

    The operation menu

    The op dropdown picks from eight entries, all on inputs a and b (BOOLEAN, default false):

    • And, Or, Nand, Nor - the classics
    • Xor, Xnor - for "exactly one" / "same state" logic
    • Eq, Neq - the same node doubling as a boolean equality/inequality check

    Output is a single BOOLEAN. XNOR is the sleeper here: not (a ^ b), which is just "are these two booleans the same?" - a one-node way to compare the output of two condition nodes. Eq does the same thing explicitly, so pick whichever reads better in your graph.

    When to use it

    The dedicated And/OR nodes are still the right call for a single gate you want to read at a glance - no dropdown to check. This node earns its spot when the logic is genuinely varied: a NAND here, an XOR there, maybe an Eq for a parity check. One node type in your saved workflow, operation chosen per instance, and you can flip an XOR to an XNOR without swapping nodes. It's also the node you'll find if you open an older JakeUpgrade workflow that predates the And/OR split.

    Installing it

    Part of ComfyUI-JakeUpgrade:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
    cd ComfyUI-JakeUpgrade
    # Windows standalone: install.bat
    # or: python_embeded\python.exe -s -m pip install -r requirements.txt
    pip install -r requirements.txt   # non-Windows
    

    Or ComfyUI Manager, search "JakeUpgrade", install, restart. Pure Python, nothing to download.

    Gotchas

    • Bitwise vs logical. In the integer sibling nodes (CM_IntBinaryOperation), "And"/"Or" are bitwise & / |. Here on booleans they're proper logic gates. Don't transplant expectations between the two.
    • Nand/Nor need a moment's thought. not (a and b) returns true in every case except both-true - that's usually what you want, but test your truth table if the behavior surprises you.
    • Manager's JakeUpgrade / IPAdapter_plus conflict warning is a false positive from the pack's replacement/ folder.
    • ComfyUI-MultiGPU causes CUDA errors with current ComfyUI - disable it, per the README.
    Category๐Ÿ‰ JK/โœ–๏ธ Math/๐Ÿฅข Bool

    Inputs (3)

    NameTypeDefaultDescription
    opCOMBOSelect binary operation to perform
    aBOOLEANfalseFirst boolean input
    bBOOLEANfalseSecond boolean input

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEANโ€”