Nodes/RES4LYF/MaskToggle
ComfyUI Node Runs on cloud

MaskToggle

An on/off switch for a mask, without rewiring your graph

By ClownsharkBatwing·Created 2 years ago·Updated 21 days ago· 1,222
MaskToggle
  • mask
  • mask
enabletrue

If you've built a RES4LYF regional-conditioning workflow with more than a couple of zones, you already know the pain: you want to check whether one particular mask is actually doing anything, so you either unplug it (and lose the link) or go hunting for a bypass. MaskToggle is the boring, useful answer to that: it's a single boolean gate sitting in front of a MASK, so you can flip a zone on or off from the node itself instead of rewiring anything.

Why it exists

RES4LYF's whole pitch on regional and temporal conditioning is "unlimited zones" - the README shows workflows with over ten masked regions feeding one generation. That's great for control and miserable for debugging, because the only way to know which mask is pulling its weight is to isolate it. A toggle node lets you do that with one click per zone instead of restructuring the graph every time you want to A/B a region.

It's a tiny node and it does one thing, which is exactly the point. It sits in a RES4LYF/masks category by itself, and it's the kind of utility you install a big pack for and then forget it's even part of it - it just quietly sits between a mask source (a paint mask, a LoadImageMask, another node's mask output) and whatever's consuming it downstream, usually a SharkOptions_GuideCond node or a regional-conditioning setup.

The inputs and outputs that matter

There isn't much here to explain, which is the appeal:

  • mask (MASK, required) - the mask you want to be able to switch on and off.
  • enable (BOOLEAN, default true) - the switch itself. Flip it in the node UI to toggle the zone without touching a wire.

Output: a single mask, wired onward exactly where the original mask would have gone.

How to install it

RES4LYF ships as one pack, and MaskToggle comes along with it - there's no separate install for individual nodes. Easiest path is ComfyUI Manager: search "RES4LYF", install, restart. Manual install is the same two commands as any other custom node pack:

cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF/

If you're on a venv, cd into the cloned folder and pip install -r requirements.txt first (or point a portable install's embedded pip.exe at it on Windows). Restart ComfyUI afterward and it'll show up under the RES4LYF category tree.

One thing worth doing while you're in there: install rgthree-comfy alongside it. It's not a MaskToggle dependency specifically, but RES4LYF's author recommends it for everyone using the pack, since it powers the nested sampler-selection menus the newer nodes rely on. If those menus don't appear after a restart, check rgthree's settings for "Auto Nest Subdirectories."

Common issues & troubleshooting

Toggling it doesn't seem to change the output. Make sure you're actually looking at the effect of the masked region, not the whole image - if the zone in question is small or its conditioning is subtle, flipping it off can be an easy-to-miss difference. Compare on a fixed seed with a converging sampler (not an ancestral one) so you're not also fighting sampling noise between runs.

You installed RES4LYF and don't see the menus described in the docs. That's the rgthree dependency above, not MaskToggle itself - a common enough point of confusion that it's worth ruling out first before assuming something's broken with the mask nodes.

You want more than on/off. This node is deliberately not a blend or opacity control - it's binary. If you want a mask fading in and out rather than switching, you're looking for a different tool (a mask math/blend node, or animating the mask's own alpha upstream); MaskToggle's job stops at enable/disable.

CategoryRES4LYF/masks

Inputs (2)

NameTypeDefaultDescription
enableBOOLEANtrue
maskMASK

Outputs (1)

NameTypeDescription
maskMASK