Mask Switch
A two-position tap for your masks
- input1
- input2
- mask
Mask Switch is a two-input, one-output selector for masks. You give it a mask on input 1, a mask on input 2, and flip an Input selector to decide which one comes out the other end. That's the whole mechanic, and it's the node you want when you're forever comparing masks rather than committing to one.
Think about how often mask work goes in this pack's direction: you've got a SAM mask from one source and a hand-painted or dilated mask from another, and you keep swapping between them to see which inpainting result you like. The alternative to a switch is unplugging and re-plugging the wire every run, which is exactly the kind of fiddly thing that makes people give up on A/B tests. A switch makes the swap a single widget flip.
The same trick extends to workflow sharing. When you hand someone a workflow, a switch tells them "there are two masks here, try both" instead of forcing them to trace wires. It's a tiny bit of affordance that pays off.
Inputs and outputs
- Input (INT, 1–2, default 1) - the selector widget. Set to 1 to output input1, 2 to output input2.
- input1 / input2 (MASK, both optional) - the two candidates.
- Output mask (MASK) - carries whichever one you selected.
One behavior worth noting: like every switch in this pack, the author borrowed the logic from the comfyroll switch set and standardized it - when the node is bypassed, it sends whatever is on input 1 through. So input 1 is effectively your "default" lane. If you want a bypassed switch to behave sensibly, put the mask you'd fall back on in slot 1.
Installing it
This is part of ComfyUI-RvTools_v2:
cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI-RvTools_v2
Restart ComfyUI, or install via ComfyUI Manager by searching "RvTools". No model files to download; the pack's dependencies are the standard torch/numpy/Pillow plus opencv-python, pilgram, pynvml and piexif, which Manager pulls in on install.
Gotchas
The pack is no longer maintained per its README, with ComfyUI_Eclipse (same author) as the designated successor - most of these nodes live on there. The v2 nodes still work; it's just a heads-up on where updates went.
Also note this is the 2-way mask switch. If you need to choose between more than two masks, this pack has multi-switch variants for other types, and for masks specifically you'd either chain switches or look at the multi-switch family's pattern - the multi-switches pick the first non-empty slot, which is a different (arguably handier) mechanic. Grab the one that matches how you actually pick masks.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| Input | INT | 11–2 | — |
| input1opt | MASK | — | |
| input2opt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |