Override Switch
The Switch That Falls Back Instead of Crashing
- condition
- true_input
- false_input
- output
Override Switch is a two-input selector that picks between true_input and false_input based on a boolean, and its one trick is what happens when an input is missing: it falls back to whatever is there instead of erroring out. That's the "override" in the name, and it's the only reason to install it.
Here's the thing you discover about a week into ComfyUI: every branching workflow needs a switch, and ComfyUI already ships one. The built-in Switch node works fine. Where Override Switch earns its keep is as a maybe node - the kind you wire into a template so that a replacement input can silently take over when it exists. You know, the workflow you wrote once and now feed different images, models, or prompts through.
How it works
The logic is dead simple. Three optional inputs, all typed * so they accept anything:
condition- the switch. Wire a boolean here.true_input/false_input- the two candidates, in and out.
One widget, Default_Input (a boolean, default False), sets which branch wins when condition isn't wired at all. That's the detail most people miss: the condition input is optional, so the node doubles as a hard override switch you flip by widget instead of by wire.
The fallback behavior, straight from the source:
conditionis truthy buttrue_inputis missing → it hands youfalse_input.conditionis falsy butfalse_inputis missing → you getNone.- Both inputs missing →
None.
So it never throws just because one side of the fork is empty. The output is a single output of type * - wire it into whatever the chosen input would have fed.
Where you actually reach for it
Build an "A/B" node in the middle of a workflow. Or a fallback chain: feed a refined input when you have one, otherwise pass the original through. That's the honest use case - a replacement that gracefully degrades. Think of it as the difference between an error box and a shrug.
The catch, and it's a real one: when it returns None, whatever's downstream has to tolerate None. Wire this into a KSampler that's expecting an image and a missing branch will still break the graph - just one node later. The node protects itself, not the rest of your pipeline.
Honest assessment: this is a small, unknown pack (there's essentially zero community chatter about it, and the ComfyUI page shows double-digit impressions). If you already run rgthree-comfy, its switch nodes do this and more with a nicer UI. Reach for Override Switch if you want the specific missing-input fallback in a single tiny node with no other baggage.
Installing
ComfyUI Manager is the easy path: search Override Switch (the pack title is "ComfyUI Override Switch") and hit install. Or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/SpaceWarpStudio/ComfyUI-OverrideSwitch.git
The README adds a pip install -e . step, but it's optional in practice - the node imports nothing but Python stdlib, its pyproject.toml lists zero dependencies, and there are no model files to download. A plain clone, restart ComfyUI, done. It's about as dependency-free as a custom node gets, which after a while you learn to appreciate.
Gotchas
conditionis anytype, so whatever you wire in gets a Python truthiness test. A 0, empty string, orNonecounts as falsy. Wire in something that's present when you want a branch taken, not something that merely exists.- The fallback is silent.
conditiontrue,true_inputunwired → you getfalse_input, no warning. If you wanted to know your replacement didn't attach, this node won't tell you. - A returned
Nonetravels downstream. Keepoutputwired into something that can accept it, or the error just moves next door.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| Default_Input | BOOLEAN | false | — |
| conditionopt | * | — | |
| true_inputopt | * | — | |
| false_inputopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |