Mute Switch (Dynamic)
The ComfyUI switch that actually skips the branch it turns off
- input_1
If you've ever built an A/B workflow - "render with the anime model or the realistic one, I'll decide at the last second" - you've hit the dirty secret of most ComfyUI switches: they compute both branches anyway, then quietly discard the loser. Mute Switch (Dynamic) is the small node from zhaocaiji's ComfyUI-Mute-Switch that doesn't do that. It physically mutes the branch you're not using, so ComfyUI never loads or runs it at all. On a workflow with a couple of heavy SDXL or Flux passes hanging off a switch, that's the difference between "watch both renders waste VRAM" and "the one you picked just runs."
It's a niche little utility with a tiny footprint in the community (you won't find threads about it - nobody's even had a reddit conversation about this author), but the mechanism is genuinely clever, so let's look at how it actually works.
How it works
The Python side is a decoy. MuteSwitch is an output node (OUTPUT_NODE = True) with no outputs, and its switch_logic function does nothing but return an empty tuple. All the real logic lives in mute_switch.js, a frontend extension that runs in the graph before execution starts. On every connection change, widget change, and canvas draw it checks the control_value, works out whether it's odd or even, and then flips the mode of the node wired into each input_x socket - setting it to 0 (Always, run it) or 2 (Never, gray it out and skip it).
That "Never" mode is the whole point. A bypassed node still gets processed and passes data through; a muted node is excluded from the execution graph entirely. Since nothing else consumes that branch (the switch is the sink), the whole thing vanishes from the run. And because the mute is a mode change on the node itself, it persists into your saved workflow JSON - re-open the file later and the grayed branch is still grayed.
The inputs that matter
The schema is tiny, which is the appeal:
control_value(INT, default1): the master switch. Odd = active, even = muted. Leave it at 1 for on, 2 for off. Yes, odd/even instead of a boolean is a weird design choice - the author built it this way so you could drive it from any integer upstream.invert(BOOLEAN, default off): flips the logic so odd mutes and even unmutes, in case your control signal arrives backwards.input_1(any type, dynamic): the actual branch inputs. Plug a wire in and a newinput_2appears automatically; unplug one and the empty sockets get cleaned up and renumbered. It'll take anything - model loaders, samplers, whatever.
There are no outputs. It's a terminal node, a workflow sink - you park it at the end of branches you want to toggle.
Installing it
Via ComfyUI Manager (search "Mute Switch" or "ComfyUI-Mute-Switch"), or the old-fashioned way:
cd ComfyUI/custom_nodes
git clone https://github.com/zhaocaiji/ComfyUI-Mute-Switch
Then restart ComfyUI. There are no model downloads and no Python dependencies beyond what ComfyUI already has - the pack is a single .py file, a .js file, and a README.
Where people get burned
- It only mutes the node you wired directly into
input_x. If that node also feeds something else, the rest of its branch keeps running. It's a switch for branches whose only consumer is this node - which is exactly the design, but don't expect group-level muting like rgthree's Fast Groups Muter. - It's a frontend tool. The mute happens in the browser before execution, so if you queue workflows purely from the API, this node does nothing for you. Work in the UI and you're fine.
- Frontend hooks are fragile. The JS rides on
nodeCreated,onConnectionsChange,onWidgetChanged- the same APIs that got roughed up when ComfyUI's Nodes 2.0 frontend rewrite landed and broke utilities like rgthree's for months. If this node ever stops muting after a ComfyUI update, that's the first thing to suspect.
Give it a shot on a two-branch workflow and watch your Vram monitor during the queue. The difference between a muted branch and a merely bypassed one is real.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| control_value | INT | 10–999999999 | — |
| invert | BOOLEAN | false | — |
| input_1opt | * | — |
Outputs (0)
No outputs