Nodes/Akatz Seamless Tiling/Any Switch | Akatz
ComfyUI Node

Any Switch | Akatz

The five-slot switch that takes anything

By akatz-ai·Created 3 months ago·Updated 2 months ago· 2
Any Switch | Akatz
  • any_01
  • any_02
  • any_03
  • any_04
  • any_05
  • *

Any Switch | Akatz is a router: five inputs, one output, and the first input that actually has a value wins. Wire five candidates into it - images, models, conditionings, strings, whatever - and it passes through whichever one comes first and isn't empty. It's the "give me A, unless A is empty then B, then C…" pattern, in a node. And because every input is typed *, you can throw almost anything at it without matching types.

Where this shines is workflow plumbing. The classic use is fallback chains: a workflow that prefers a user-supplied value but falls back to a default when none is given. Or you're building a batch workflow where some runs produce an image and others don't - route the results through this node and only the real ones flow on. It's also handy for A/B setups where you're toggling which of several branches feeds the rest of the graph by leaving the others unconnected.

A couple of design choices that matter in practice:

  • "Empty" is defined generously. A None counts as empty, and so does a primitive dict whose model and clip are all None - which is what an uninitialized pipe/patch object looks like in ComfyUI. So you can feed this node the output of nodes that produce "empty" placeholder values and it'll correctly skip them rather than forwarding garbage downstream.
  • Order is by the input number, any_01 through any_05. Plug your candidates in priority order; the first non-empty one is what you get.
  • It returns None if all five are empty. If everything upstream is empty, you get an explicit None rather than a silent crash - which is exactly what you want in a fallback chain, because the next node can see that something's missing.

The pack's variant_support machinery relaxes type checking so the * inputs and output play nice with ComfyUI's type validation - you won't get a spurious "wrong type" error when you connect a MODEL to an input meant for an image, because they're all just * here.

Install

It ships with the Akatz Seamless Tiling pack, same install as its siblings:

cd ComfyUI/custom_nodes
git clone https://github.com/akatz-ai/Akatz-Seamless-Tiling

Restart ComfyUI, or use ComfyUI Manager and search "Akatz Seamless Tiling". The node pattern is adapted from the deforum-comfy-nodes pack (the README credits it), and it's one of the genuinely portable pieces of this pack - it'll find its way into workflows that never touch seamless tiling at all.

Troubleshooting

  • Nothing comes out and the next node errors - all five inputs were empty, so it returned None. Check which input you expected to be populated and why it wasn't.
  • The "wrong" input won - remember it's priority order, not "most recently connected." Disconnect or leave unconnected the inputs you don't want in the race; unconnected inputs count as empty.
  • It feels like a wire-crossing anti-pattern - the ecosystem has strong feelings about anything-anywhere routing (there's a famous "please stop using" post about it). Used sparingly as a fallback, it's fine. Used as a way to make every workflow a spaghetti bowl, it's a debugging nightmare. Pick your poison deliberately.
CategoryAkatz Seamless Tiling/Logic

Inputs (5)

NameTypeDefaultDescription
any_01opt*
any_02opt*
any_03opt*
any_04opt*
any_05opt*

Outputs (1)

NameTypeDescription
**