Generator Switch (only selected runs)
Ten generator chains in one workflow, and only the one you pick ever runs
- generator_1
- generator_2
- generator_3
- generator_4
- generator_5
- generator_6
- generator_7
- generator_8
- generator_9
- generator_10
- selected
Most "switch" nodes in ComfyUI are just routing valves - they pick one input and pass it through, and every input upstream still executes. The Generator Switch is not that, and the difference is the entire point. It's lazy: the ten generator chains hanging off its inputs are not executed at all unless you select them. No model loads, no VRAM, no time spent on the nine chains you didn't pick.
That's a real feature in an upscaler. The Smart Upscaler workflow's image-model block is meant to be swappable - one workflow can carry Z-Turbo, Klein, SDXL and Flux chains at once, wired and ready, and cost nothing for the three it isn't using. You flip one dropdown instead of rewiring half a graph.
How it works
The mechanism is ComfyUI's lazy evaluation: each of the generator_1…generator_10 inputs is marked lazy, and the node only requests the one matching the dropdown selection. Because the inputs are wildcard * sockets, a chain can be anything - a sampler, a whole subgraph, even a plain value. The node's own docs put it plainly: "only the selected generator input is ever evaluated."
The dropdown labels even get relabeled by the web extension with the connected chain's name (something like "3: Flux 1"), so you're picking by identity, not by number.
Inputs
- generator - the dropdown, Generator 1 through Generator 10. The one that runs.
- generator_1 … generator_10 (optional, wildcard) - the chains themselves. Wire a
Set_from KJNodes at the end of each chain into the matching slot. - generator_number (optional) - an override: connect one shared integer to keep several switches in sync (handy if you have a couple of these and want them to agree). 0 or unconnected = use the dropdown.
One output: selected, a wildcard that carries whatever the chosen chain produced.
The README's wiring recipe: build a chain, end it with a Set_ node, connect a matching Get_ to a spare generator_ input, and pick it from the dropdown. Chains you don't select never execute.
Why it beats group-muting
You can mute groups with rgthree or bypass nodes, but that's you manually telling ComfyUI what not to run, and it doesn't touch the graph's execution cost the same way. Lazy inputs mean the unselected branches aren't even part of the run. The author's framing, from the README: "One workflow can carry Z-Turbo, Klein, SDXL and Flux at once and cost nothing for the three it isn't using." For an upscaler where the whole point is that the generator block is replaceable, that's the difference between a usable multi-model workflow and a wall of commented-out nodes.
Install
Same pack, same story:
cd ComfyUI/custom_nodes
git clone https://github.com/HallettVisual/ComfyUI-Smart-Upscaler
or search "ComfyUI-Smart-Upscaler" in ComfyUI Manager, then restart. The shipped workflow also wants ComfyUI-KJNodes (the Set_/Get_ wires) and rgthree-comfy (comparison sliders) - both from the Manager. No Python deps beyond ComfyUI; the ~13 GB of models in docs/MODELS.md are the only downloads, and each chain's own model is what you pay for when you select it.
Gotchas
- Legacy names still load. The class is
SmartModelEngineSwitchand old graphs sendengine_3-style socket names; the node accepts both, so a pre-1.1.0 workflow keeps working. The dropdown parses the first number out of any label, so even a weird relabeled value falls back to slot 1 rather than failing. - Nothing selected that you meant to run? Check the dropdown actually says the chain you wired - with ten wildcard sockets it's easy to fill
generator_3while the dropdown sits on 1. The relabeled names make that visible. - This is a routing node, not a debugger. If the workflow refuses to start, ComfyUI still validates nodes reachable from outputs - a generator chain that references a missing model will fail the run even if it's not selected. The pack hit this exact problem with an optional ESRGAN loader and fixed it by shipping it unwired; keep your unselected chains load-bearing only if their loaders are present.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| generator | COMBO | Generator 1 | Which connected generator chain to run. Chains that are not selected are never executed - no model loads, no VRAM, no time. |
| generator_1opt | * | Generator chain 1. Only the selected generator is executed. | |
| generator_2opt | * | Generator chain 2. Only the selected generator is executed. | |
| generator_3opt | * | Generator chain 3. Only the selected generator is executed. | |
| generator_4opt | * | Generator chain 4. Only the selected generator is executed. | |
| generator_5opt | * | Generator chain 5. Only the selected generator is executed. | |
| generator_6opt | * | Generator chain 6. Only the selected generator is executed. | |
| generator_7opt | * | Generator chain 7. Only the selected generator is executed. | |
| generator_8opt | * | Generator chain 8. Only the selected generator is executed. | |
| generator_9opt | * | Generator chain 9. Only the selected generator is executed. | |
| generator_10opt | * | Generator chain 10. Only the selected generator is executed. | |
| generator_numberopt | INT | 00–10 | Optional override: connect one shared number to keep several switches in sync. 0 or unconnected = use the dropdown. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| selected | * | — |