SwitchAnyMute
Two inputs, one output, and the loser doesn't even run
- true
- false
- output
A boolean switch that picks between two inputs sounds like the most boring node in the world. The twist here is in the pack's own description: "Efficiency Version - Keep unselected input silent to optimize performance." Plain switches route data; SwitchAnyMute doesn't even execute the losing branch. Flip it off and the entire upstream chain behind the true input goes quiet - no sampling, no processing, nothing.
That's the difference that makes it worth having. In a heavy workflow, a plain switch still evaluates both sides and throws one away; SwitchAnyMute only evaluates the side you selected. Think of it as a power switch rather than a router.
How it works
The surface is minimal. One switch widget (BOOLEAN, default false), two optional * inputs named true and false, and one output. Both inputs are declared lazy. The node's check_lazy_status reports that it only needs the input matching the current switch state, so ComfyUI skips computing the other one entirely. At execution it just returns whichever input matched.
This is the lazy-input mechanism from the ComfyUI node-plumbing playbook done right: the engine only walks the graph branches that the node actually asks for. The unselected branch sits there, fully wired, costing you zero compute and producing zero side effects.
What you'd use it for
Any two-way toggle where the unused path is expensive or has side effects. Classic: switching between txt2img and img2img by toggling whether a source image feeds the sampler - when it's off, the whole image-loading-and-prep pipeline doesn't run. Or a "debug mode" toggle that detours a branch through extra masking you don't want in production. Because the dead branch is truly dead, it's also great for keeping experiments in the graph without paying for them every run - you don't have to mute or delete nodes to stop them running.
Where it's not the right pick
It's a two-way switch, so for more than two options you want SwitchAnyCombo (same pack) which gives you a menu of up to ten inputs with the same lazy treatment. And note the inputs are named true/false to match the widget - if you wire one into the wrong one, your switch works backwards, which is a very easy mistake to make on a late Friday night. When switch is false, the false input passes through; the default is false, so wire accordingly.
Installing it
It ships in ComfyPanel:
cd ComfyUI/custom_nodes
git clone https://github.com/Ginolazy/ComfyPanel
Restart ComfyUI, or search ComfyPanel in ComfyUI Manager. The pack's requirements are the usual torch/numpy/Pillow plus kornia, scipy, and opencv-python; Manager will prompt for anything missing. No model downloads, and the Photoshop plugin isn't needed for this node to work standalone.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| switch | BOOLEAN | false | — |
| trueopt | * | — | |
| falseopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |