Link Switch
A checkbox that switches a whole branch on and off — Link Switch
- 输入
- 输出
You've built a workflow with an optional branch - say, an upscale pass, or an extra ControlNet, or a second img2img route - and you want to flip it on and off without deleting half your graph. wcx_LinkSwitch is the checkbox for that: one input of any type, one boolean switch, and one output. Switch on, the input passes through untouched. Switch off, the output becomes None.
This is the "null-output placeholder" pattern from the KB's node-plumbing doc, and it's worth understanding exactly why it works. ComfyUI treats an unwired optional input as None, so a node that deliberately emits None is how you mute a branch from inside the data rather than by bypassing nodes. When the switch is off, everything downstream that has an optional input just sees "not connected" - which is precisely the signal a fallback switch or first-non-null chain expects in order to skip that branch.
The only knobs are the three: input (labeled 输入 - the * wildcard type, so it accepts anything: IMAGE, LATENT, MASK, STRING, you name it), switch (labeled 开关, a boolean toggle, default on), and output (labeled 输出). Note the port names render in Chinese in the UI - that's a quirk of this pack, harmless once you know it. The node also declares a VALIDATE_INPUTS that always passes, which is how a wildcard-type node tells ComfyUI "trust me, I know what I'm doing," so you can wire anything in.
Where people get burned:
Noneout only works whereNoneis welcome. If the switch is off and the downstream node has a required input - one it can't live without - you'll get an error, not a graceful skip. This node plays nice with optional inputs and fallback switches, not with mandatory ones.- It's a gate, not an A/B switch. One input, one output. If you want to flip between two different sources, that's a different node - this one just opens or closes a single path.
- The input isn't validated against the output. Because everything is
*, you can feed a latent on one side and connect the output to a mask input. ComfyUI won't stop you; the confusion will be downstream.
Standard light install, no dependencies beyond the pack:
# ComfyUI Manager: search "ComfyUI-Practical-Tools" → Install → restart
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/wenchengxiang/ComfyUI-Practical-Tools
# restart ComfyUI
It's a simple node with a simple contract, and used correctly - in front of optional inputs, next to a fallback switch - it's how you turn "rip out the branch to test without it" into "untick a box and re-run."
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| 输入 | * | — | |
| 开关 | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 输出 | * | — |