Lazy MultiGen Switch (Qwen / Flux)
A switch that only runs the branch you pick
- input1
- input2
- output
Normal ComfyUI switches have a dirty secret: they evaluate every input before choosing one. Wire two expensive generation branches into a switch and both run every time, which completely defeats the point of having a switch. IAMCCS LazyAnySwitch fixes that with the lazy flag - ComfyUI only executes the branch you actually selected, and the other one never runs.
The display name says "Lazy MultiGen Switch (Qwen / Flux)" and the defaults reflect it: the two inputs are input1 (Qwen) and input2 (Flux). This is the routing node for the pack's multi-generation dataset workflows - the ones that run prompt variants through either Qwen image-edit or Flux Klein, depending on the path.
How it works
select is a combo with Qwen and Flux, defaulting to Qwen. Internally it normalizes that to a 1 or 2, then check_lazy_status tells ComfyUI which input to actually compute. Only the selected input's upstream graph executes; the unselected branch is skipped entirely. The output is ANY type, so it can carry a model, an image, a latent, or anything else - it's a true ANY switch, not a typed one.
If the selected input isn't connected, you get a clear ValueError naming which input is missing rather than a silent None. That's the right failure mode for a lazy node - much better than watching the wrong branch run.
Why lazy matters here
Switching between a Qwen image-edit chain and a Flux Klein chain isn't like switching between two colors. Each is a full multi-GB model load plus a sampling run. With a non-lazy switch you'd be paying for both on every execution. With this node, flipping the combo changes which model the graph even loads. If you're building one workflow that does double duty as Qwen-or-Flux, this is the node that makes that practical.
Install
Part of IAMCCS-nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git
or ComfyUI Manager → search IAMCCS, restart. No extra dependencies.
Gotchas
Remember that laziness only applies to the inputs of this node. Anything else connected in parallel to the same upstream still runs normally - lazy switching saves the branch you didn't pick, not the rest of the graph. And keep the branch naming in mind: input1 = Qwen, input2 = Flux, so wire the two sides consistently or your "switch" will quietly route to the wrong generator.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| select | COMBO | Qwen | 2 options: Qwen, Flux |
| input1opt | * | — | |
| input2opt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |