Mask Minority Region
Keep only the smallest blob in a mask
The mirror image of WAS's Mask Dominant Region: where that node keeps only a mask's largest connected blob, this one - per the README - "returns the smallest region in a mask (the smallest area)." Most of the time the smallest blob in a messy mask is exactly the noise you're trying to get rid of, which makes Minority Region a slightly unusual ask on its own. But there's a real use for it: sometimes the small thing genuinely is your target - a stray marker, a small defect flagged by a detection step, a tiny feature that a segmentation pass happened to isolate as its own separate island alongside a much bigger region you don't actually care about.
How it works
It identifies every separate connected region of white pixels in the mask - the same region-finding pass Mask Dominant Region uses - measures each one's area, and keeps only the single smallest, zeroing out everything else including the dominant blob. It doesn't reshape, smooth, or crop the surviving region; it purely removes the competition. If you also want a tight crop around that smallest region instead of a full-size mask with everything else blacked out, WAS's paired Mask Crop Minority Region node does that.
What it takes and gives back
Mask in, mask out. A MASK goes in; a MASK containing just the minority region comes out, ready to drop into whatever was going to consume the original - a targeted fix, a crop node, a compositing step.
Where it's genuinely useful
Isolating a specific small feature that a noisier or looser upstream mask also captured alongside a large, irrelevant region - a defect detector that also lit up the whole background, a color threshold that grabbed both a small object and a big swath of similarly-tinted floor. Rather than trying to hand-paint out the large region, Minority Region just discards it automatically by size.
How to install it
ComfyUI Manager: search "WAS Node Suite," install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui
then, from inside that folder, install requirements - path/to/ComfyUI/python_embeded/python.exe -s -m pip install -r requirements.txt on portable, plain pip install -r requirements.txt on system Python - and restart. It's under the WAS Suite menu, no model download involved.
Common issues & troubleshooting
The output is empty or unexpected. Usually the input mask genuinely doesn't have a clean minority region to find - several small fragments of near-identical size, or a mask that's mostly one connected blob with no real second region. Preview the input mask first; it's often telling you something true about the source that isn't obvious at a glance.
It picked a different small region than the one I wanted. "Minority" strictly means smallest area. If your mask has multiple small fragments, whichever is marginally smallest wins the comparison, even if it's not the specific feature you had in mind. Clean the mask first - a threshold pass, Mask Fill Holes - so the region you actually want is unambiguously the smallest.
Whole pack fails to import. This is a simple morphological operation with no dependency of its own, so it's unlikely to break on its own merits. The risk that applies is pack-wide: WAS Node Suite has had no active development since December 2023, and the recurring complaint since is the entire suite failing to import after a ComfyUI update - a shared dependency clash, not anything specific to this node. Reinstall requirements with your embedded Python interpreter, not a system one, if it happens.
Inputs (0)
No inputs
Outputs (0)
No outputs