DD XOR Gate
The \"exactly one, never both\" condition
- *
XOR is the exclusive-or gate: true when exactly one of its two inputs is true, false when both are true or both are false. It's the "one or the other, never both" condition, and it's the gate most likely to surprise you if you've never met it, because it rejects the case where everything is true.
Two boolean inputs, expression1 (default true) and expression2 (default false), one boolean output. The logic:
- exactly one true →
true - both true →
false - both false →
false
Why you'd reach for it
XOR is your "mode must be exclusive" gate. Two settings that should never both apply - "use the fast model" and "use the high-quality model," say. Both toggled on is a conflict, and XOR is the only gate that treats that conflict as its false case instead of its true case. You wire both toggles in, and the branch fires only while exactly one is active.
It's also the gate for parity-style checks - "these two things should differ." Portrait-vs-landscape decisions, A-vs-B mode selectors, anything where the two conditions are supposed to be mutually exclusive. When you want "differ," XOR is the one-liner; when you want "same," that's XNOR.
The honest take
Of the three inverted gates in this pack - NAND, NOR, XNOR - XOR is the one with real day-to-day mileage, because exclusivity is a genuine workflow concept and core ComfyUI doesn't give you a tidy node for it. It's still a niche tool compared to AND and OR, but "exactly one" comes up often enough that having it as a single readable node beats assembling it from two Not gates and an Or.
Defaults are worth noting: expression1 is true, expression2 is false - so a fresh node is already in the "exactly one true" state and outputs true. If you connect only one expression and leave the other unwired, you're stuck in that state and the output won't change until you wire the second one. Both inputs connected, and everything behaves.
Installing
The shared DD-LogicNodes path: ComfyUI Manager → search DD-LogicNodes → Install → restart, or git clone https://github.com/dumbdemon/DD_LogicNodes into ComfyUI/custom_nodes. No dependencies, no model downloads. Keep ComfyUI current - the pack is built on the newer extension API, so an old build won't have these nodes in the menu.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| expression1 | BOOLEAN | true | — |
| expression2 | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | BOOLEAN | — |