Recursive switching🔀
Output the first input that's actually connected
- input1
- input2
- output
This one's a different animal from the rest of the ergouzi-kaiguan pack. Where the group switches turn whole sections of your graph on and off, EGRYDZQHNode - labeled "Recursive switching🔀" - works one connection at a time: feed it several inputs, and it hands back the first one that actually has a value, skipping any that are empty. If you've used a coalesce or "first non-null" function in any other tool, this is that, built as a ComfyUI node.
The practical use case is priority fallback. Say you sometimes wire a custom prompt into your workflow and sometimes don't - instead of a separate switch node and a bypass to route around it, you plug your custom prompt into input1 and your default prompt into input2, and this node just gives you whichever one is actually there. No custom prompt connected this run? It falls through to the default automatically.
How it works
The node exposes a starting pair of optional inputs - input1 and input2 - and checks them in order, returning the first one that isn't empty as its single output. The README describes it as expandable beyond two: you can set how many inputs to switch between and give each one a name from the node's own UI, so on a busy graph you're not stuck guessing what "input4" was supposed to feed. It's genuinely a data-flow utility rather than a decorative one - no mascot animations tied to this node, no group-toggle behavior. It just resolves "which of these do I actually have" and moves on.
The inputs and outputs that matter
- input1, input2 - optional, wildcard-typed. Wire your options in priority order; the first one carrying a value wins.
- output - wildcard-typed, wherever the winning input's value goes next in your graph.
Both inputs are optional by design - that's what lets you leave one disconnected on a given run and have the node fall through to the other without erroring.
How to install it
Search Comfyui-ergouzi-kaiguan in ComfyUI Manager and install, or clone it directly:
cd ComfyUI/custom_nodes
git clone https://github.com/11dogzi/Comfyui-ergouzi-kaiguan.git
Restart ComfyUI afterward. No requirements.txt, no model files - this node, like the rest of the pack, is pure Python and JS logic.
Common issues & troubleshooting
It's outputting the wrong input. Check evaluation order - it goes by input number, so if input1 has any value connected (even one you'd rather it skip), that's what comes out, and input2 never gets a look-in. Reorder your wiring if the priority is backwards from what you want.
You need more than two fallback options. The base schema ships with input1 and input2, but the node supports adding more - use its own UI controls to increase the input count and label each one, rather than trying to wire a third input into a socket that isn't there yet.
Both inputs are typed as wildcard, so ComfyUI won't stop you from mismatching types. Since the sockets accept anything, it's on you to keep what you feed input1 and input2 consistent (both prompts, both conditioning, whatever) - plugging genuinely different data types in and expecting the downstream node to handle either will just move the error one hop further down the graph.
This isn't a group toggle. If you were looking for the "mute/bypass a whole section of my workflow" nodes from this same pack, that's GroupSwitchNode, GroupSwitchNodee, GroupSwitchNodeee, or GroupSwitchNodeeee instead - EGRYDZQHNode operates on a single wire, not a group.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| input1opt | * | — | |
| input2opt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |