Any Multi-Switch Purge
Fallback routing with a VRAM cleanup before the winner runs
- any_1
- any_2
- *
Any Multi-Switch Purge is the fallback switch with a memory foot on the door. Same as the plain Any Multi-Switch - up to 64 wildcard inputs, first non-empty wins, no selector to maintain - plus one Purge_VRAM checkbox that fires Eclipse's VRAM purge before the node hands the selected value on. If your switch is choosing between branches that each load heavy models, this is the version that makes room for the winner.
When the purge actually earns its keep
ComfyUI unloads unused models on its own, but it's a background-ish affair and it can get caught short - the classic case being a fallback switch where any of several branches might win, so several big models stay resident to keep all options warm. On a tight GPU, the winner then OOMs on load. A purge before switching unloads every ComfyUI-managed model and clears the accelerator caches, so the winning branch starts from a clean slate. That's the whole value proposition, and it's a real one if you've ever watched a fallback workflow OOM on a 6GB card.
The Purge_VRAM flag is a plain boolean widget, default False. Leave it off and this node behaves exactly like the non-purge version - which is worth doing when your branches are lightweight, because unloading and reloading models is not free. It's a fix for tight VRAM, not a default setting.
Inputs and behavior
inputcount- how manyany_Nsockets to expose (1–64, default 2); sockets update automatically as you change it.Purge_VRAM- the checkbox.any_1…any_N- the branches, highest priority first; empty/Noneslots are skipped.- Output - the first non-empty input, or
Noneif everything is empty.
The purge runs before the node returns, which means it happens before anything downstream loads the winner's model. Ordering is the whole point.
Lazy or purge - pick your poison
The Eclipse router family gives you both Any Multi-Switch Lazy (only the winning branch executes at all) and Any Multi-Switch Purge (everything executes, then VRAM is cleared). For model-heavy alternatives, Lazy is usually the better answer - it avoids the wasted compute and the resident-memory problem, because only the winning branch ever runs. The Purge variant makes more sense when you can't use lazy evaluation (say, a branch has side effects you want to keep) but still want the memory floor cleared. If that sounds like decision fatigue: start with Lazy, fall back to Purge only if you have a concrete reason.
Installing it
Part of ComfyUI_Eclipse, installed once:
cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI_Eclipse
Restart ComfyUI (or ComfyUI Manager → search "ComfyUI Eclipse"). No extra dependencies.
Gotchas
Pack-wide, as always: ComfyUI_Eclipse was formerly RvTools and v4.0.0 removed all legacy nodes - old workflows fail to load until you run the Workflow Migration Tool node (or python tools/migrate_workflow.py <workflow.json>) which rewrites old IDs with a backup. And if a purged run seems slower, that's the reload tax, not a bug - the checkbox is doing exactly what it says.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| inputcount | INT | 21–64 | Number of ANY inputs to expose. Inputs update automatically. |
| Purge_VRAM | BOOLEAN | false | If enabled, purges VRAM before switching. |
| any_1opt | COMFY_MATCHTYPE_V3 | Any input #1 (highest priority). Leave empty to bypass. | |
| any_2opt | COMFY_MATCHTYPE_V3 | Any input #2 (used if #1 is empty). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | COMFY_MATCHTYPE_V3 | The selected output. |