Nodes/NIX ComfyUI Plugin/NIX_SwitchAnything
ComfyUI Node

NIX_SwitchAnything

A switch that passes through whatever type you throw at it — image, model, string, anything

By J-ChenX·Created 11 months ago·Updated 11 months ago· 2
NIX_SwitchAnything
  • anything_1
  • value
index1

NIX_SwitchAnything is the node you reach for when you need to pick between several things - and you don't care, or don't know yet, what type those things are. It takes a bunch of inputs, an index, and returns whichever input the index points at. Image, model, conditioning, string, tensor, whatever. If it can be a wire, this node can pass it through.

That any-type flexibility is exactly what makes it powerful and exactly what makes it worth using carefully. ComfyUI has a long-running argument about "Anything" nodes - the community famously ran a thread titled "Please Stop using the Anything Anywhere extension" - because untyped routing makes workflows impossible to debug. A node that swallows any type hides what's flowing through it. This node is fine; just don't build a whole graph out of it.

It's part of the NIX pack - small, dependency-free (numpy + Pillow, both already in ComfyUI), no models.

How it works

Required inputs: anything_1 and index (INT, min 1). The pack ships a small web extension that adds dynamic anything_2, anything_3, ... inputs as you need them, so you grow the switch by adding slots rather than having a fixed set. The index selects which slot to output - 1 returns anything_1, 2 returns anything_2, and so on.

The output is value, typed as * (any type). The node clamps index to a minimum of 1, and if you select a slot that isn't connected, it returns None - so an unplugged branch silently produces a null rather than erroring. That's a feature when you're building conditionally, and a footgun when you forget to wire something.

Where it slots in

The natural pairing in this pack: NIX_StringMatcher gives you an index from a string, NIX_SwitchAnything turns that index into the right branch. LLM returns "portrait" → matcher gives 2 → switch sends the portrait pipeline through. It's also handy for A/B testing (flip the index between two samplers or two LoRA configs) and for conditional pipelines where a boolean upstream selects between a full-detail pass and a pass-through.

Getting it installed

  • ComfyUI Manager: search "NIX" / "NIX ComfyUI Plugin", or Install Custom Nodes → Git URL → https://github.com/J-ChenX/ComfyUI-NIX. Restart after.
  • By hand:
    cd ComfyUI/custom_nodes
    git clone https://github.com/J-ChenX/ComfyUI-NIX
    
    Restart ComfyUI. Under the "NIX" category.

Things that will bite you

  • Unconnected slot → None, not an error. If your output suddenly disappears, check whether the selected slot is actually wired.
  • Any-type is a debugging tax. When something misbehaves, this node won't tell you what type it moved. If you know the type (always images? always strings?), a typed switch from another pack is easier to reason about.
  • Dynamic inputs need the web folder. On an install missing web/, you may only get anything_1 and have to add the rest manually.
  • Quiet pack. No community signal for NIX as of mid-2026, so no copied workflows - but the switch logic is a few readable lines in the source if you want to confirm the None behavior.
CategoryNIX

Inputs (2)

NameTypeDefaultDescription
anything_1*
indexINT1

Outputs (1)

NameTypeDescription
value*