Nodes/comfyui-mixlab-nodes/Outline Mask ♾️Mixlab
ComfyUI Node Runs on cloud

Outline Mask ♾️Mixlab

Turn a mask into a border ring

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
Outline Mask ♾️Mixlab
  • mask
  • MASK
outline_width10
tapered_cornerstrue

Take a solid mask and this gives you back just its edge - a ring of a chosen thickness tracing the boundary, instead of the filled shape. Feed it a filled circle, get a donut. It's a small utility, but it solves a specific problem: when you want to operate on the border of a region rather than its interior. Think outlines, glows, edge-only inpainting, seam blending, or building a feathered transition band between a subject and its background.

Nothing exotic here - it's a mask-shaping helper. But it's the kind of node that's annoying to fake by hand (you'd normally grow the mask, shrink another copy, and subtract), so having it in one node is a real convenience.

How it works

Conceptually it dilates the mask outward by the outline width and keeps only the newly-added band - the difference between the grown mask and the original edge - producing a border of the thickness you asked for. The tapered_corners option controls how the growth handles corners: on, it rounds them off (the standard ComfyUI grow-mask behavior) for a softer, less blocky outline; off, it keeps corners sharp and square. For most organic shapes you want tapering on.

Inputs and outputs

  • mask (MASK, required) - the source mask you want the outline of.
  • outline_width (INT, default 10) - how thick the border ring is, in pixels. Small values (2–5) for a thin trace; larger for a chunky band you can feather into a blend region.
  • tapered_corners (BOOLEAN, default true) - round the corners of the growth (true) or keep them sharp (false).

The single output is MASK - the border ring. Wire it wherever a mask goes: as a glow/edge region, as the transition band for compositing, or into a blur to make a feathered seam.

How to install it

Ships with the Mixlab pack.

  • ComfyUI Manager: search comfyui-mixlab-nodes, install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git, install requirements (install.bat on Windows or ../../../python_embeded/python.exe -s -m pip install -r requirements.txt), restart.

Common issues

Outline too thin or too thick: it's just outline_width. Remember the band grows outward from the original mask edge, so a wide outline eats into surrounding area - keep that in mind if you're near the image border or another object.

Blocky corners: turn tapered_corners on. If you specifically wanted crisp geometric corners (say, outlining a rectangle), turn it off.

"Nothing came out": if your input mask is empty or a single pixel, there's no meaningful boundary to trace and you'll get little or nothing. Feed it a real filled region. And if your mask is already a thin line rather than a filled shape, outlining it may not do what you expect - this node is for turning filled masks into edges, not for thickening existing lines (though a wide outline on a thin mask will effectively fatten it).

It's one small piece: on its own an edge mask isn't the goal - pair it with a blur for feathering, or subtract/combine it with other masks to build the exact region you need. It's a building block, not a finished effect.

Category♾️Mixlab/Mask

Inputs (3)

NameTypeDefaultDescription
maskMASK
outline_widthINT101–16384
tapered_cornersBOOLEANtrue

Outputs (1)

NameTypeDescription
MASKMASK