Nodes/Sagado Nodes for ComfyUI/Any Type Switch Multi
ComfyUI Node

Any Type Switch Multi

Flip One Boolean, Swap the Whole Wiring Harness

By 5agado·Created about a year ago·Updated 3 days ago· 1
Any Type Switch Multi
    • OUTPUT_1
    inputcount1
    switchtrue

    You're A/B-ing a new checkpoint against your old one. Same workflow, two loaders, two CLIPs, two VAEs. The usual fix is bypassing three nodes one at a time, and remembering which three. The Any Type Switch Multi does it with one toggle: it takes pairs of inputs and passes one side wholesale to a matching set of outputs. Flip the boolean, the whole lane flips.

    That's a small thing until your "B" branch is a completely different pipeline.

    What it actually is

    SGD_Any_Type_Switch_Multi is one node from 5agado's Sagado Nodes, a personal-utility pack ("to cover personal needs... or to avoid dependencies on other node packs" - the README's own summary). This one is the multi-lane sibling of the pack's plain Any Type Switch.

    Worth knowing where it sits in the switch family. There are two shapes people call "switch": an A/B switch, which has a selector and passes whichever input you point it at, and a fallback switch, which has no selector and just grabs the first input that isn't empty - rgthree's Any Switch is the canonical fallback. This node is firmly the first kind, with the selector being a single boolean for all lanes at once.

    How it works

    Every socket is declared as the * type - ComfyUI's escape hatch, the one input type that "can be connected to any source." A switch doesn't care whether it's routing an IMAGE, a LATENT or a MODEL, so it refuses to pick a type. That's the mechanism behind the name.

    Two details are worth understanding because they explain the UI you're about to stare at.

    The pins are generated by JavaScript, not Python. The Python side only declares inputcount and switch. The on_true_1 / on_false_1 / OUTPUT_2 pins are added by the pack's frontend extension (web/js/utils.js), which reads inputcount and then adds or removes pins to match. Which is why there's an Update Inputs button, and why changing the number alone does nothing: you type the count, then click the button, and the sockets appear.

    It only runs the branch you selected. The node implements check_lazy_status, which ComfyUI's executor calls to ask which inputs a node actually needs this run. It answers with only the selected side's pin names. The engine then refuses to execute the other side's upstream nodes at all. Practically: your "off" branch can be a second sampler chain, a heavy upscale, a whole LoRA stack, and it costs you nothing while the switch is on. That's the real reason to prefer this over bypassing groups by hand.

    Inputs and outputs

    • inputcount (INT, 1–1000, default 1) - how many pairs and how many outputs. Set it, then click Update Inputs.
    • switch (BOOLEAN, default true) - true pulls from every on_true_i, false from every on_false_i.
    • on_true_1, on_false_1, … - the dynamic pins, any type, wired in pairs.
    • OUTPUT_1, OUTPUT_2, … - one output per pair, same type that went in. Wire these into whatever the pair was feeding.

    Keep each lane type-consistent. There's nothing stopping you from feeding an IMAGE into on_true_1 and a MODEL into on_false_1, and the node will happily emit whichever you picked - you'll just get a confusing error three nodes downstream instead of a clear one here.

    Installing

    ComfyUI Manager → search "Sagado Nodes for ComfyUI". Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/5agado/ComfyUI-Sagado-Nodes
    cd ComfyUI-Sagado-Nodes && pip install -r requirements.txt
    

    Then restart ComfyUI and hard-refresh the browser tab. No models to download, no config.

    Be aware the pack's requirements.txt is torch, pillow, numpy, ollama - the Ollama client is there for the pack's LLM nodes, not this one, so installing the full requirements set pulls a dependency you don't need for switching. The project also declares Python ≥ 3.12 in pyproject.toml.

    Common issues

    The pins didn't appear. Click Update Inputs. It doesn't auto-fire when you change the widget.

    Pins appeared, then disappeared. Lowering inputcount and clicking Update removes the extra pins and the wires attached to them. Save before you experiment.

    A workflow loads with the right pins but a fresh node doesn't. The pin count is stored in the workflow file, so loaded workflows are fine; it's new nodes (and any node whose layout the extension never rebuilt) that depend on the JS running. ComfyUI's Nodes 2.0 frontend rewrite is exactly the thing that broke third-party canvas extensions across the ecosystem in late 2025, so if the button does nothing, hard-refresh first - it's the cheap fix.

    Downstream nodes refuse the connection. A * output looks untyped to the UI, so an IMAGE-only input may refuse to accept the wire. Wire it anyway and let execution resolve the concrete type - but if you're switching one type forever, a purpose-built switch is less annoying to live with.

    CategorySagado-Nodes

    Inputs (2)

    NameTypeDefaultDescription
    inputcountINT11–1000
    switchBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    OUTPUT_1*