If-Else Logic Gate (PixNodes)
The merge point for your two branches
- true_path
- false_path
- output
The Pix_IfElseDispatcher is the fork in the road; this is where the road comes back together. Pix_IfElseLogicGate takes two inputs - true_path and false_path - and passes through whichever one actually carried data. The other one, you'll remember, was sent down a branch that ComfyUI blocked rather than ran, and the gate's only job is to recognize that and pick the live one.
Two wildcard * inputs, one wildcard * output named output. Under the hood it checks whether true_path is an ExecutionBlocker - the sentinel the dispatcher injects into the branch it didn't take. If true_path is blocked, it returns false_path; otherwise it returns true_path. That's the entire function, and it's worth being precise about because the direction matters: the gate defaults to the true branch and only falls through to false_path when the true side is blocked. So wire your primary/expected result into true_path and the fallback into false_path, and the gate naturally prefers the primary.
Why not just a switch with a selector? Because you don't always know at wiring time which branch will be live. The dispatcher decides at runtime based on the boolean you fed it, and the gate merges based on what actually ran - no selector to set, no chance of pointing at the wrong input. It's the "first non-null wins" shape that rgthree popularized with Any Switch, but tuned for the PixNodes block-sentinel system.
This node only makes sense as the second half of the dispatcher pattern, and the two are really one feature split across two pages. Build it like this: Pix_IfElseDispatcher → (both branches) → whatever processing lives on each side → both wires into Pix_IfElseLogicGate → single output continues the graph. A common real use: a fallback pipeline. Branch A runs the expensive high-quality sampler; branch B is a cheap quick pass. When the condition (say, "is this a first pass?") is false, the cheap branch runs and the gate hands you its result.
One subtlety that trips people: the gate itself will happily sit there if neither input is blocked and both carry data - then you get true_path and the false_path value is silently discarded. That's expected; the dispatcher is supposed to guarantee exactly one live branch. If you wire this node up without a dispatcher upstream and feed it two real values, it behaves like a hardcoded "always take the true side," which is almost certainly not what you meant.
Install is the standard PixNodes route - ComfyUI Manager, search PixNodes, restart - or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/pixixai/Comfyui-PixNodes
cd Comfyui-PixNodes
pip install -r requirements.txt
then restart. Only openai and Requests in requirements, no models, no VRAM. Read it together with the Pix_IfElseDispatcher article; on its own this node is a one-trick pony, but as the closing half of the fork/merge pair it's the node that lets your workflows make real decisions.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| true_path | * | — | |
| false_path | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |