Dominant Mask Regions
Keep only the biggest blob in a messy mask
- masks
- MASKS
Run a subject through BiRefNet or SAM and you rarely get one clean blob back - you get the subject, plus a stray pixel cluster on a shadow, plus a fleck near the frame edge the model got confused about. SaltMaskDominantRegion is the one-node fix: it looks at every separate connected shape in your mask and throws away everything except the biggest one. No more manually erasing specks before you composite or inpaint.
How it works
It's connected-component analysis, the classic image-processing move: treat every isolated blob of "on" pixels in your mask as its own region, measure each region's area, and keep only the largest. Everything smaller gets zeroed out. Before it can count regions, though, it needs a hard yes/no mask rather than a soft grayscale one - that's what threshold is for. Anything above the threshold reads as foreground, anything below reads as background, then the connected-component pass runs on that binary result.
The inputs and outputs that matter
Two inputs, both required, and there's a gotcha in the second one:
masks- your input MASK, presumably something with more than one region in it (a clean single-blob mask, this node does nothing to).threshold(default 128, range 0–255) - this is on an 8-bit scale, not the 0.0–1.0 float scale ComfyUI masks normally use. That's your tell that under the hood this is converting to an 8-bit image before running the region analysis. Default 128 means "anything past roughly 50% opacity counts as foreground."
Output is a single MASKS - same shape as your input, just with every region except the dominant one erased. Wire it straight into whatever consumed the original mask (a composite node, an inpaint crop, a KSampler's mask input).
How to install it
The README's own framing: this repo ships Salt AI's platform nodes plus "general helpful nodes, such as primitive converter, masking nodes, and compositing." Salt AI (getsalt.ai) launched in March 2024 as a service for deploying ComfyUI workflows to Discord bots and, eventually, an API - WASasquatch, the author of the widely-used WAS Node Suite, was the one who announced it. This masking sub-family was the part of the repo useful with or without their platform.
Here's the thing worth knowing before you go looking, though: as of writing, github.com/get-salt-AI/SaltAI returns a 404. The get-salt-AI org is still there - it still hosts SaltAI-Web-Docs, SaltAI-Academy, and a ComfyUI fork - but this specific node repo isn't in it anymore, and it's not indexed in ComfyUI Manager's node list either. Community mentions of "Salt AI" the platform basically stopped after early 2025, for what it's worth. If a fresh git clone https://github.com/get-salt-AI/SaltAI 404s on you, that's not something wrong on your end. If you already have this node - say, it came bundled in a workflow's environment - that install is fine to keep running; you just won't be able to pull it fresh from the documented URL right now. No models to download, no heavy dependencies - it's plain OpenCV/NumPy-style mask math.
Common issues & troubleshooting
You set threshold like it's 0–1 and nothing changes. It's 0–255. Setting it to 1 effectively treats almost the entire mask as foreground; you probably meant something in the 100–180 range.
It did nothing to my mask. If your input mask is already one solid region, there's nothing for this node to trim - that's expected, not a bug. It earns its keep specifically on multi-blob, noisy masks.
Two subjects of similar size, and it picked the "wrong" one. "Dominant" means largest by pixel area after thresholding, full stop - it has no idea which blob is your actual subject. If you need a specific region rather than the biggest one, reach for SaltMaskRegionSplit instead and pick the output socket you want.
No per-node documentation exists upstream - the README doesn't go deeper than the one-line repo description, and there's no separate doc page for this node that's reachable right now. The fastest way to be sure of the exact behavior on your mask is to wire the output straight into a Preview Image node and look.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | — | |
| threshold | INT | 1280–255 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASKS | MASK | — |