Any Int Switch
Route seeds, steps and batch sizes by connection order
- int
Any Int Switch picks the first connected INT it finds and passes it to the int output. That's the whole mechanism - and it's surprisingly useful because integers are the hidden plumbing of every workflow. Seeds, steps, batch sizes, cfg-ish knobs, mask feather values: half the decisions in a graph are numbers, and this node decides between them by slot order instead of a dropdown.
You've probably met the fallback-switch idea before. rgthree's Any Switch is the community's canonical version, and the "first non-null input wins" pattern is the standard way to let several optional branches share one consumer without a selector. This node is the same idea, typed and locked to integers - no wildcard socket, so there's no way to accidentally wire a string into it.
How it works
Start with int_1, and each time you wire another integer source a new slot appears - int_2, int_3, and so on. On execution it grabs every connected input that isn't None and returns the one in the lowest-numbered slot. Muted or bypassed upstream nodes are the key trick here: they deliver None, and None inputs are skipped, so muting a branch lets the next slot win automatically. Connect nothing and it errors loudly rather than pretending.
Because INT is one of the pack's "force input" types, the sockets are wire-only - there's no number box on the node, so the value always comes from somewhere real in the graph.
Where you'd use it
- Seed routing. Two branches that each produce a seed, one consumer - whichever branch is live feeds the sampler.
- Steps presets. Wire a "draft" steps value in
int_1and a "final" value inint_2, mute one, done. - Fallback logic. Preferred source first, fallback second, and the graph chooses itself.
Install
ComfyUI Manager → search "Tojioo Passthrough" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Tojioo/tojioo_passthrough.git
Restart ComfyUI. There's nothing to download beyond the repo - no models, no pip dependencies, and it's on the Comfy Registry under publisher tojioo.
Common issues
Slot order is the whole game, so re-read it if the "wrong" value shows up: the lowest-numbered connected slot wins, not the last one you touched. If int_2 is winning over int_1, check int_1's upstream for a mute/bypass. And don't leave all slots empty - the node raises "no inputs connected" instead of quietly returning a value. Everything else about the node is deliberately boring, which is what you want from plumbing.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| int_1opt | INT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| int | INT | — |