Nodes/ComfyUI-Artha-Nodes/πŸ”± Artha Logic Gate
ComfyUI Node

πŸ”± Artha Logic Gate

AND, OR, XOR and friends for your workflow's conditionals

By CyrostarΒ·Created 10 months agoΒ·Updated 8 months agoΒ· 0
πŸ”± Artha Logic Gate
    • state
    β—„gateANDβ–Ί
    β—„aβ€”β–Ί
    β—„bβ€”β–Ί

    Artha Logic Gate is the πŸ”± Artha pack's Boolean combiner: two Booleans in, one Boolean out, with the operation chosen from a gate dropdown. It's the "combine these conditions" node of the Logic family - the thing that turns "the flag is on and the image is big enough" into a single decision the rest of the graph can react to.

    If Compare is where conditions are computed, Gate is where they're combined. It's the same idea as the logic gates in any electronics or programming course, just rendered as a node.

    How it works

    The gate dropdown offers seven operations: AND, OR, XOR, NAND, NOR, XNOR, NOT. Inputs are two Booleans - a is required, b is optional and defaults to false when unwired. Every gate except NOT uses both; NOT ignores b entirely and just inverts a.

    The output is a single state BOOLEAN, computed exactly as you'd expect from the gate names: AND is true only if both are, OR is true if either is, XOR is true if they differ, and the N/XN variants are the negations of those. Standard truth-table behavior, nothing exotic.

    Inputs that matter

    • gate - the operation, defaults to AND.
    • a - required Boolean.
    • b - optional Boolean, defaults to false if left unwired. Watch this: an unwired b on an AND gate means the output is always false unless a is somehow both true and... it isn't. For AND/OR to be useful, wire b up.

    Output: state (BOOLEAN).

    Installing it

    One-pack install, same as the Artha family:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Cyrostar/ComfyUI-Artha-Nodes
    pip install -r ComfyUI/custom_nodes/ComfyUI-Artha-Nodes/requirements.txt
    

    restart ComfyUI, or search "ComfyUI-Artha-Nodes" in ComfyUI Manager. No API key, no models, no dependencies beyond the pack's baseline - pure Python boolean logic.

    Common issues

    • AND gate always outputs false: b is unwired and defaults to false. Wire both inputs.
    • NOT gate "doesn't work": NOT only reads a; if you fed b expecting it to matter, it won't.
    • NAND/NOR/XNOR surprise people: they're the negated versions - NAND outputs false only when both inputs are true. That's the point, but it catches people who expected the gate to just mean "and".

    Where you'll actually use it: gating a branch so it only runs when two conditions hold, XOR-ing two comparison results to detect a change, or inverting a flag with NOT. Paired with the pack's Compare and Basic nodes, Gate is what lets you build actual if statements into a ComfyUI graph.

    CategoryArtha/Logic

    Inputs (3)

    NameTypeDefaultDescription
    gateCOMBOAND7 options: AND, OR, XOR, NAND, NOR, XNOR, +1
    aBOOLEANβ€”
    boptBOOLEANβ€”

    Outputs (1)

    NameTypeDescription
    stateBOOLEANβ€”