Mask Crop Minority Region
Crop straight to a mask's smallest blob
The mirror of Mask Crop Dominant Region: where that node crops to a mask's largest blob, this one - per the README - "crops mask to the minority region with optional padding in pixels," meaning it targets the smallest connected region instead. Most of the time the smallest blob in a mask is noise you're trying to get rid of. This node is for the less common but real case where the small thing is exactly what you want - a stray marker, a small defect, a specific tiny feature that a segmentation pass happened to isolate as its own little island alongside a much bigger region you don't care about.
Why you'd want the smallest blob, cropped
If your target is small relative to the image, carrying a full-canvas mask around wastes effort - same logic as the dominant-region crop, just pointed at the opposite end of the size distribution. Crop straight to the small region's bounding box, with padding so you're not cutting right against its edge, and you've got a tight, workable piece to feed a targeted fix, a close-up regeneration, or a matching image crop at the same coordinates.
How it works
It finds every separate connected region in the mask, measures each one's area, and - instead of keeping the largest like its Dominant sibling - keeps the single smallest one and crops the output down to that region's bounding box. The optional padding sets margin around the crop; without it, you're cropping right up against the tiny blob's edge, which leaves nothing to feather if you're planning to composite the result back in later.
The inputs and outputs that matter
A MASK in, plus padding in pixels for margin around the crop. The output is a MASK cropped tightly to the minority region's bounding box, expanded by whatever padding you set. The same inpainting hygiene applies here as anywhere else in WAS's crop family: modidex's inpainting notes put typical mask feathering around 4–12 pixels, with too little causing a visible hard seam and too much bleeding past the intended edit - treat padding here with the same care.
Installing it
ComfyUI Manager: search "WAS Node Suite," install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui
install requirements.txt against your ComfyUI Python, restart. Pure morphology and cropping - no model to download.
Common issues & troubleshooting
It grabbed a different tiny region than the one I meant. "Minority" means smallest area, and if your mask has several small, similarly-sized fragments, whichever one is marginally smallest wins - which may not be the specific feature you intended. Clean the mask first so the region you actually want is unambiguously the smallest, or isolate it another way before feeding this node.
The crop is basically empty or a single pixel. If the minority region really is tiny noise rather than a real feature, cropping to it produces exactly that - a near-nothing crop. That's usually a sign the mask needs cleanup upstream (a threshold pass, Mask Fill Holes), not that this node is misbehaving.
Whole pack fails to import. WAS Node Suite has been unmaintained since the author marked it retired in December 2023; the recurring failure is the entire suite throwing "Import Failed" after a ComfyUI update because a shared pinned dependency clashes with the new version. Reinstall requirements.txt against the correct, embedded Python interpreter and restart.
Inputs (0)
No inputs
Outputs (0)
No outputs