DD NAND Gate
The \"everything except both-true\" gate
- *
NAND is the odd one out in the gate family, and it's worth being honest about that up front: you will reach for it less than AND or OR. In electronics it's the famous universal gate - every other gate can be built from NANDs. In a ComfyUI workflow, what it gives you is a single node that says "true for every combination except both-true."
Two boolean inputs, expression1 and expression2 (defaults true and false), one boolean output. The logic is exactly not (expression1 and expression2):
- both true →
false - everything else →
true
When it earns its keep
The mental model that makes NAND useful: "run this unless both conditions are set." That's a different shape from AND ("run only when both are set"). A concrete example - you have two conditions that both being true should suppress something, like "skip the fallback upscaler if the image is already large AND the prompt demands speed." Both true means the fallback is suppressed; anything else means it runs.
It's also the gate you want when you're combining booleans before feeding another logic node, and you want the inverted result without adding a separate DD Not Gate. One node instead of two is a small win, but a real one in a graph you'll read again in a month.
A quick note on defaults
Watch the defaults. expression1 defaults to true and expression2 defaults to false - so a fresh, unwired NAND gate outputs true (since both-true isn't met). That's the correct default behavior for the gate, but if you drop one in, connect a single condition, and leave the other input unwired, you may be surprised the output stays true no matter what you do. Connect both expressions and you're fine.
Installing
Same story as every node in this pack: ComfyUI Manager → search DD-LogicNodes → Install → restart, or git clone https://github.com/dumbdemon/DD_LogicNodes into ComfyUI/custom_nodes. No dependencies, no models, nothing to download. The only real system requirement is a current enough ComfyUI - the pack is built on the newer extension API, so on older builds the node simply won't be in the menu.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| expression1 | BOOLEAN | true | — |
| expression2 | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | BOOLEAN | — |