ComfyUI Node

Split Regions

Pull up to six separate blobs out of one mask

By get-salt-AI·Created 2 years ago·Updated 2 years ago· 84
Split Regions
  • masks
  • region1
  • region2
  • region3
  • region4
  • region5
  • region6

A segmentation pass that finds "all the people in this image" hands you back one mask with several disconnected blobs in it - useful if you want to affect all of them at once, useless the moment you want to treat person A differently from person B. SaltMaskRegionSplit breaks a multi-blob mask apart into up to six separate mask outputs, one region per socket, so you can grab exactly the one you want and route it wherever it needs to go - its own inpaint pass, its own color grade, its own detailer.

How it works

Connected-component analysis again, the same foundation as SaltMaskDominantRegion and SaltMaskRegionLabeling in this pack - every isolated blob in the mask gets identified, and instead of filtering or coloring them, each one gets routed to its own dedicated output socket. That's the practical ceiling worth knowing about up front: there are exactly six output sockets (region1 through region6), so this node is built for masks with a handful of distinct blobs - a few people, a few objects - not for a mask riddled with dozens of small specks. The pack doesn't document what happens past six regions (whether extras get dropped, merged into the last socket, or something else), so if you're anywhere near that count, check the actual outputs rather than assume.

The inputs and outputs that matter

  • masks (required, MASK) - the multi-region mask you want to break apart.

Outputs: region1 through region6, all type MASK. There's no threshold parameter here - unlike SaltMaskDominantRegion and SaltMaskRegionLabeling, this node has no way to control what counts as a separate region before splitting, so whatever connectivity already exists in your input mask is what you get split. If two blobs are touching, they'll come out as one region, not two.

How to install it

SaltMaskRegionSplit is part of get-salt-AI/SaltAI ("SaltAI-Open-Resources"), built by Salt AI (getsalt.ai) - a company that launched in March 2024 running ComfyUI workflows as hosted Discord bots and, later, via API. This masking family shipped as the general-purpose toolkit in the same repo, independent of that platform.

Before you go looking for it: github.com/get-salt-AI/SaltAI currently returns a 404. It's gone from the org's visible repo list, and it's not in ComfyUI Manager's node index either, so a Manager search or a fresh git clone both come up empty right now. If it's already installed, you're unaffected - it's a plain connected-component operation, no models, no live dependency on Salt AI's own infrastructure.

Common issues & troubleshooting

Two regions you expected as separate outputs came out combined in one socket. If your source blobs are touching or overlapping at all - even by a single pixel - connected-component analysis treats them as one region. Run SaltMaskGaussianRegion in reverse (i.e., check for accidental blur bleeding them together upstream) or verify the source mask actually has a gap between the two shapes you're expecting.

You have more than six distinct blobs and don't know where the rest went. This is the sharpest edge case with this node, and it's genuinely undocumented - the pack gives you six sockets and no stated overflow behavior. If your use case regularly produces more than six regions, treat this node as unreliable for that case and either pre-filter with SaltMaskDominantRegion/SaltMaskMinorityRegion first to cut the count down, or verify each output manually with Preview Image nodes before trusting the wiring.

An output socket you're using is empty, or fully black. If your source mask genuinely has fewer than six regions, the unused sockets presumably output an empty mask rather than erroring - worth confirming on your own graph, and worth not wiring a downstream node to a socket you haven't verified has real content.

You don't actually need all six regions separated, just the one biggest or smallest. If you only care about a single extreme, skip the multi-output complexity and reach for SaltMaskDominantRegion or SaltMaskMinorityRegion instead - simpler graph, same underlying analysis, one output instead of managing six.

CategorySALT/Masking/Filter

Inputs (1)

NameTypeDefaultDescription
masksMASK

Outputs (6)

NameTypeDescription
region1MASK
region2MASK
region3MASK
region4MASK
region5MASK
region6MASK