Any Dual-Switch Purge
The A/B switch that drops VRAM before it flips
- input1
- input2
- *
Any Dual-Switch Purge is Any Dual-Switch with one extra checkbox bolted on: Purge_VRAM. Same two-input A/B routing, same wildcard sockets, same everything - but when the purge flag is on, the node calls Eclipse's VRAM purge routine before passing the selected value. The purge unloads every ComfyUI-managed model and clears all unused accelerator caches. It's the "I'm about to load a different 7GB model, make room" switch.
Why the purge variant exists
ComfyUI already manages VRAM and unloads models that aren't in use. So when do you need a manual purge? When the old model's weights are still resident and the new branch is about to load something big - a switch between two heavy loaders in one graph is the classic case. Instead of trusting ComfyUI to evict in time (it usually does, but sometimes you're right at the edge), you force a clean slate first. It's also the cure for the specific failure where switching branches causes an out-of-memory error because the previous model never got freed.
The Purge_VRAM flag is a plain BOOLEAN widget (default False), so it's a checkbox you toggle when you need it. Leave it off and this node is byte-for-byte an Any Dual-Switch. Flip it on and it's a memory barrier that happens to also route your data.
Inputs and behavior
Input- selector, 1 or 2, default 1.Purge_VRAM- the checkbox. On, it purges before switching.input1/input2- the two wildcard inputs.- Output - the selected value, or
Noneif that input is empty.
The purge is before switching, which matters: it runs when the node executes, so the model from the branch you're leaving gets unloaded before the branch you're entering asks for its weights. That's the ordering you want.
When to actually use it
Reach for this one when you're A/B-ing two model-heavy branches on a GPU with thin headroom. If you're switching lightweight things - strings, images, latents - the purge is pure overhead and you should just use the plain Any Dual-Switch. The purge itself is not free; unloading and reloading models costs time on the next run. It's a tool for tight VRAM, not a default.
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, the usual: ComfyUI_Eclipse was formerly RvTools, and v4.0.0 removed all legacy nodes. Load an old workflow and it fails until you run the Workflow Migration Tool node (or python tools/migrate_workflow.py <workflow.json>) to rewrite the old IDs with a backup. And remember - if your switch "loads nothing" after flipping it, double-check the selector position, not the purge.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| Input | INT | 11β2 | Select which input to output (1 or 2). |
| Purge_VRAM | BOOLEAN | false | If True, purges VRAM before switching. |
| input1opt | COMFY_MATCHTYPE_V3 | First input (any type). | |
| input2opt | COMFY_MATCHTYPE_V3 | Second input (any type). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | COMFY_MATCHTYPE_V3 | The selected output. |