Skeletonize Mask Regions
Reduce a blob to its centerline
- masks
- MASKS
Skeletonization is a classic topology operation: take a solid blob and thin it down, iteratively, until what's left is a one-pixel-wide line running through the middle of the original shape - its medial axis, or "skeleton." A thick painted stroke becomes a centerline. A blobby hand-drawn shape becomes something closer to a stick figure. SaltMaskSkeletonization does this to a mask, and it's the kind of node you reach for when you need a shape's structure rather than its area - driving a line-art effect, extracting a rough centerline for further processing, or turning a filled region into something resembling a pose or stroke path.
How it works
The standard algorithm here (and the one basically every implementation of this converges on, whether it's scikit-image's skeletonize or an OpenCV thinning routine) repeatedly erodes pixels from the boundary of each region while checking that it doesn't break the shape's connectivity or its topology - you don't want a solid blob to accidentally split into two disconnected pieces, or a loop to get pinched shut, partway through thinning. It keeps stripping boundary pixels in passes until nothing more can be removed without breaking the shape, at which point what remains is the skeleton.
The inputs and outputs that matter
masks(required, MASK) - the blob(s) you want to reduce to their centerlines.iterations(optional, default 1, range 1–10) - how many thinning passes to run. A full skeletonization algorithm typically converges on its own once no more pixels can be safely removed, so this is more likely a pass-count cap than something you need to max out - start at 1 and only raise it if the result still looks under-thinned.strength(optional, default 1, range 1–12) - presumably controls how aggressively each pass thins the shape. Since this isn't documented beyond the parameter name, the practical approach is to try a couple of values on a test mask and watch how the result changes before committing to a setting in a real workflow.
Output: MASKS, thinned to (or toward) a one-pixel-wide skeleton.
How to install it
SaltMaskSkeletonization ships in get-salt-AI/SaltAI ("SaltAI-Open-Resources"), from Salt AI (getsalt.ai) - the company that launched in March 2024 running ComfyUI workflows as hosted Discord bots and, later, an API. This masking node family was the general-purpose toolkit shipped alongside their platform-specific nodes.
Flag before you go looking: github.com/get-salt-AI/SaltAI returns a 404 as of writing. It's not in the org's current repo listing and it's absent from ComfyUI Manager's index, so the usual Manager search or a fresh git clone both come up empty. Already installed, it needs nothing further - plain mask math, no model downloads, no dependency on Salt AI's servers staying up.
Common issues & troubleshooting
The output looks broken or disconnected where the original shape was solid. A well-behaved skeletonization algorithm should preserve topology - a connected blob stays connected, a loop stays a loop - but thin, wispy, or noisy input regions (a mask with jagged edges, or several nearly-touching small blobs) can produce a messier or more fragmented skeleton than a clean, smooth shape would. Feeding it a mask that's already been through SaltMaskFillRegion or SaltMaskGaussianRegion first tends to give cleaner results than a raw, noisy segmentation output.
Cranking strength or iterations didn't visibly change anything. If your mask's shape is already thin (close to line-width already), there may be little left to thin further - skeletonization can only remove pixels, not add detail, so a source shape near skeleton-width to begin with will look nearly unchanged regardless of settings.
You wanted a smooth curve and got a jagged one. Skeletonization operates pixel by pixel and follows exactly the geometry of your input mask; a blocky or aliased source shape produces a blocky skeleton. If you need a smoother result, soften the input mask (SaltMaskGaussianRegion, followed by a re-threshold) before skeletonizing, rather than trying to fix jaggedness after the fact.
No documentation exists for exactly what strength controls. That's an honest gap in the pack's own docs, not something this page is hiding - the safest path is testing a small mask at a few strength values side by side in Preview Image before you rely on a specific setting.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | — | |
| iterationsopt | INT | 11–10 | — |
| strengthopt | INT | 11–12 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASKS | MASK | — |