Label Mask Regions (RGB)
See how many blobs your mask actually has
- masks
- images
Every other node in this filter family assumes you already know how many separate blobs are in your mask. SaltMaskRegionLabeling is the node that tells you. It runs connected-component analysis and paints each distinct region a different color, then hands you back a regular image you can actually look at - instead of a grayscale mask where three overlapping blobs and one blob look identical at a glance, you get a colorized map where each one is visually distinct. It's a debugging node, and a genuinely useful one before you commit to SaltMaskDominantRegion, SaltMaskMinorityRegion, or SaltMaskRegionSplit downstream.
How it works
Same connected-component foundation as SaltMaskDominantRegion and SaltMaskMinorityRegion - binarize with threshold, find every isolated blob, and here, instead of filtering by size, assign each labeled region its own color and composite them into a single RGB image. That's also the tell that this node's output type is different from its siblings: where the rest of the filter family returns MASK, this one returns IMAGE, because the whole point is to make the region breakdown visible rather than to feed a mask further down your graph.
The inputs and outputs that matter
masks(required, MASK) - the mask you want to inspect.threshold(optional, default 128, range 0–255) - same 8-bit scale asSaltMaskDominantRegion's threshold, not the 0.0–1.0 scale ComfyUI masks normally use. This decides what counts as "on" before regions get counted and colored, so if two blobs look like they should be separate but come out the same color, try adjusting this first - a threshold that's too permissive can merge them into one connected region before labeling even runs.
Output: a single images (IMAGE) - plug it into a Preview Image or Save Image node to actually look at it. It doesn't feed back into mask-consuming nodes; it's for your eyes.
How to install it
SaltMaskRegionLabeling ships in get-salt-AI/SaltAI ("SaltAI-Open-Resources"), Salt AI's (getsalt.ai) open-source node pack. Salt AI launched in March 2024 offering hosted infrastructure to run ComfyUI workflows as Discord bots and, later, an API; this masking family was the general-purpose part of the repo, useful with or without the platform.
The catch: github.com/get-salt-AI/SaltAI returns a 404 right now. It's not in the org's current repo list and it's missing from ComfyUI Manager's index, so neither a Manager search nor a fresh git clone currently finds it. If you already have it installed, nothing changes for you - it's a self-contained visualization node with no model weights and no dependency on Salt AI's platform staying online.
Common issues & troubleshooting
Two blobs you expected to be separate came out as one color. Lower threshold isn't automatically the fix and can go either direction depending on your mask - the point is that region detection happens before coloring, so if your two shapes are touching or overlapping at your current threshold, the algorithm sees one connected region, not two. Nudge the threshold and re-run; if that doesn't separate them, they may genuinely be touching in the source mask.
The colors don't mean anything specific. Don't read meaning into which region got which color - this is a labeling/visualization pass, and the color assignment is just for visual distinction between regions, not an indicator of size, position, or importance.
You wired the output into a node expecting MASK and it errored. This node's output is IMAGE, not MASK - that's deliberate, since the job here is visual inspection, not producing something for further mask math. If you need the actual separated regions as masks (not just a picture of them), use SaltMaskRegionSplit instead.
You want this to tell you an exact region count as a number. It doesn't output a count - just the colorized image. Counting distinct colors visually, or cross-checking against SaltMaskRegionSplit's six output sockets, is the closest you get without reading the node's source directly.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | — | |
| thresholdopt | INT | 1280–255 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |