Nodes/LLS-node/LLS Mask Process
ComfyUI Node

LLS Mask Process

Grow, blur, fill holes, threshold

By Gin3601·Created 3 months ago·Updated 3 months ago· 0
LLS Mask Process
  • mask
  • image
  • mask
operationpassthrough
value_float0.50
value_int8

Rough masks are the norm. A hand-drawn mask has wobbly edges, stray specks, and hard boundaries that will show up as seams in an inpaint. LLS Mask Process is the cleanup node: one mask in, one mask out, with a dozen operations to pick from, plus a couple of value fields to tune them.

The operation dropdown is the whole node. The ones you'll actually live on:

  • grow / shrink - expand or contract the mask by value_int pixels. Growing a mask before inpaint is the classic fix for "my edit didn't cover the whole thing."
  • blur / feather - soften the edges so the generated content blends instead of sitting on a hard line. This is the anti-seam dial.
  • threshold - snap everything above value_float to pure white, everything below to black, to kill faint noise.
  • invert - flip the mask (edit the background instead of the subject).
  • fill_holes - close internal gaps so you don't leave untouched islands inside the region.
  • remove_small_regions - drop specks smaller than value_int pixels.
  • smooth, clamp, passthrough - gentle variants and a no-op.
  • resize_to_image - resize the mask to match an optional image input, so a mask and its source image always line up.

The two value fields share duty: value_float (0–1, default 0.5) is the threshold knob; value_int (default 8, range ±512) is the pixel-size knob for grow/shrink/blur/region removal. Only the image input is optional, and it's only used by resize_to_image.

Where it fits

This is the middle stage of a mask pipeline: create a mask (geometric or drawn), then process it, then feed it to the repair chain. The KB's inpainting guide is worth keeping in mind here - mask feathering of 4–12 pixels is the typical seam-fix range, and growing the mask by a little beats painting precisely when you're removing something. LLS Mask Process gives you those exact dials.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/Gin3601/LLS-node
# restart ComfyUI

Or ComfyUI Manager → search "LLS-node". Pure tensor ops on torch, no model downloads.

Gotchas

It's a one-at-a-time node: want grow and blur? Chain two LLS Mask Process nodes, or use it with LLS Mask Combine to restack the result. Also worth knowing: feather and blur use the same blur implementation under the hood, so they're near-identical in effect - don't stack both expecting a magic difference. And remove_small_regions can swallow legitimately thin mask arms if your value_int is too aggressive; keep it small and eyeball the result before it goes into an expensive sampler pass.

CategoryLLS/Mask

Inputs (5)

NameTypeDefaultDescription
maskMASK
operationCOMBOpassthrough12 options: passthrough, threshold, invert, grow, shrink, blur, +6
value_floatFLOAT0.500–1
value_intINT8-512–512
imageoptIMAGE

Outputs (1)

NameTypeDescription
maskMASK