Nodes/comfyui_gr85/MaskBatchToSEGS
ComfyUI Node

MaskBatchToSEGS

Turning your own masks into Impact Pack's detection format

By veighnsche·Created 2 years ago·Updated 8 months ago· 1
MaskBatchToSEGS
  • mask
  • SEGS
combinedfalse
crop_factor3.0
bbox_fillfalse
drop_size10
contour_fillfalse

If you've used Impact Pack's Detailer at all, you know it eats a format called SEGS - a list of detected regions with crops, masks and confidence baked in, usually produced by a YOLO or SAM detector node. Mask Batch to SEGS is the bridge for when you already have a mask from somewhere else - your own segmentation step, SAM2, one of this pack's other mask nodes - and want to feed it into that same Detailer pipeline instead of running a separate detector. It converts a mask straight into SEGS, no bounding-box model required.

That's also almost certainly why it's filed under the pack's "GR85/Florence2" category even though it doesn't take a Florence2 input directly: the natural pipeline this slots into is Florence2 doing open-vocabulary text-to-box detection (or SAM2 doing point/box segmentation), producing a mask, which this node then packages into the SEGS format that Impact Pack's Detailer, SEGS Paste and friends expect. It's plumbing, not a detector itself.

The knobs that matter. combined (default off) decides whether the whole mask gets treated as one SEGS entry or whether separate regions in the mask become separate entries - leave it off if your mask has multiple distinct blobs you want detailed independently. crop_factor (default 3, matching Impact Pack's own convention on its detector nodes) is how much padding around each detected region gets included in the crop that's handed to the Detailer's resampling pass - too tight and the detail pass loses context, too loose and you're wasting compute padding empty background. drop_size (default 10) throws away any region smaller than that pixel size, so stray noise pixels in your mask don't turn into a batch of useless micro-detections. bbox_fill and contour_fill both default off; bbox_fill swaps a region's actual mask shape for its full rectangular bounding box, and contour_fill fills the interior of a mask's outline solid rather than preserving any holes. Output is a single SEGS.

Installing it. comfyui_gr85 itself installs the normal way - search it in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/veighnsche/comfyui_gr85

Restart ComfyUI. But this node's output is only useful with ComfyUI-Impact-Pack also installed, since SEGS is Impact Pack's type and nothing else consumes it. If you're building this pipeline from scratch, you'll also want a mask source upstream - Florence2 nodes for text-prompted detection, or a SAM/SAM2 pack, or a plain manual mask editor.

Where people get stuck. ComfyUI doesn't validate custom type names at graph-build time, so you can wire SEGS from this node into a random node that happens to accept "anything" and it'll look fine right up until it errors at runtime - if nothing downstream seems to do anything with the output, double-check Impact Pack is actually installed rather than assuming the wiring is wrong. drop_size set too high is the other common trap: if your regions are legitimately small (fine detail, distant faces), the default 10px threshold can silently drop the exact regions you wanted detailed - watch the SEGS count against how many distinct regions your source mask actually has.

CategoryGR85/Florence2

Inputs (6)

NameTypeDefaultDescription
maskMASK
combinedBOOLEANfalse
crop_factorFLOAT3.01–100
bbox_fillBOOLEANfalse
drop_sizeINT101–16384
contour_fillBOOLEANfalse

Outputs (1)

NameTypeDescription
SEGSSEGS