EZ Switch
Pass anything through, choose by index, random, or first non-empty
- *
A switch is one of those nodes you don't realize you need until you're rebuilding the same graph three times. EZ Switch is the pack's version, and it has one feature most switch nodes lack: its inputs and output are typed ANY, so it can pass models, images, latents, strings - anything - not just text. The author credits the dynamic-input logic to Bjornulf's nodes and says it's "inspired by Impact Pack," and it's the node he built because the existing switches annoyed him. For a beginner, think of it as a manual selector: wire several things in, pick which one comes out, change your mind by clicking instead of rewiring.
The three modes
- by index -
selected_indexdecides which input (1 throughnumber_of_inputs) passes through. Default mode, the predictable one: bump the number and the graph changes which branch feeds forward. - by random - picks a non-empty input at random on each queue. Connect
opt_seedand it becomes deterministic; leave it unconnected and the node deliberately re-executes every run so you get a fresh pick each time. This is the mode for "show me a random one of these three styles." - automatic - outputs the first input that isn't
None. This is the workhorse for fallback logic: wire a full preset in slot 1, a fallback in slot 2, and the node hands you whatever's actually connected. If you leave slot 1 empty, it quietly falls through to slot 2.
The inputs are dynamic like EZ Text Concatenate - number_of_inputs (2–50) controls how many slots appear, and only the last slot is affected when you change it, so your existing wiring doesn't shuffle around.
The one thing to respect
ANY is a double-edged sword. Because the node does zero processing, it will happily pass a model object, an image, or a latent through untouched - but it also can't protect you from yourself. Wire its output into a node that expects a specific type and you'll get a validation error at queue time, not a helpful one. The README warns about exactly this: "if you try to pass its output to a node that does not expect certain type, you will get an error." Use it as a router between same-typed branches and you're fine.
Install
It ships in EZ-AF Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/ez-af/ComfyUI-EZ-AF-Nodes.git
restart, or ComfyUI Manager → search ez-af. No models, no deps beyond the pack's aiohttp/Pillow. There are core ComfyUI alternatives for text-only switching, but if you need to switch models or images by index or randomly, this is the pack's reason to exist - and the automatic mode's first-non-None fallback is genuinely handy for building workflows that degrade gracefully when you haven't wired every optional branch.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| number_of_inputs | INT | 22–50 | Dynamically select number of inputs. Only the last of current inputs may be affected when this value is changed |
| selected_index | INT | 11–50 | Index of input to be passed to output (if in 'by index' mode) |
| selection_mode | COMBO | by index | modes: - by index: Select input by specifying index - by random: Choose a random input each time - automatic: Output the first input that is not None |
| opt_seedopt | INT | 00–18446744073709550000 | Control SEED, used only in 'by random' selection mode. If not connected, always re-executes node on prompt |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | Unprocessed value of any type. |