Nodes/DD-LogicNodes/DD XOR Getter
ComfyUI Node

DD XOR Getter

Pick the exclusive mode, skip the other branch

By dumbdemon·Created 6 months ago·Updated a day ago· 0
DD XOR Getter
  • on_true
  • on_false
  • *
expression1true
expression2false

The XOR Getter is the value-routing version of the DD XOR Gate: same "exactly one, never both" condition, but instead of a boolean it hands you whichever value you picked for the outcome - and it lazily skips the branch it doesn't pick. This is the getter you want for exclusive modes.

Standard getter shape: on_true and on_false (MatchType - they adopt whatever you plug in), plus expression1 (default true) and expression2 (default false), and one * output that matches the input type. The rule:

  • exactly one expression true → on_true
  • both true, or both false → on_false

Why you'd reach for it

Anywhere two modes must be exclusive, and each mode has its own payload. "Fast model" vs. "quality model" as toggles - wire the fast model's result into on_true, the quality model's into on_false. The workflow branches only when exactly one toggle is on, and the conflict case (both on) gracefully falls to on_false instead of blowing up. Or a portrait/landscape split where the two orientations feed different resize chains: exactly one of those conditions can be true, and this node routes to the matching chain.

The lazy part is the reason to use it rather than a plain switch. on_true and on_false are lazy, so ComfyUI only executes the branch the node actually needs - the losing chain's upstream never runs. When one side of an exclusive choice is a heavyweight sampler, that's not a nice-to-have, it's the difference between "one chain runs" and "both chains run and you wait."

Watch the default state

expression1 defaults true, expression2 defaults false - which is already "exactly one true," so a fresh node routes to on_true and stays there until you wire both expressions. Connect only one side and the output is locked. That's XOR semantics doing exactly what it should; just don't expect movement until both conditions are actually connected.

The honest take

Of all the getters in the pack, this one has the narrowest everyday use - exclusivity checks are rarer than "both true" or "either true" logic. But when a workflow genuinely needs an A-or-B-but-not-both mode with real payloads on each side, this is the single node that does it with lazy execution built in. Keep it in the toolbox even if you rarely reach for it.

Installing

The shared DD-LogicNodes install: ComfyUI Manager → search DD-LogicNodes → Install → restart, or git clone https://github.com/dumbdemon/DD_LogicNodes into ComfyUI/custom_nodes. No dependencies, no models. Needs a current-enough ComfyUI for the newer extension API - on old builds the node won't appear in the menu.

CategoryDD Logic Nodes/Getters

Inputs (4)

NameTypeDefaultDescription
on_trueCOMFY_MATCHTYPE_V3
on_falseCOMFY_MATCHTYPE_V3
expression1BOOLEANtrue
expression2BOOLEANfalse

Outputs (1)

NameTypeDescription
*COMFY_MATCHTYPE_V3