SamAutoMaskSEGS
Segment everything in an image and get it back as RLE
- sam_model
- image
- RLE_SEGS
Point SAM at an image with no prompt at all - no box, no click, no text - and its automatic mode will find every object it can and hand back a mask for each one. SamAutoMaskSEGS runs exactly that: Meta's Segment Anything Model in full auto-everything mode, then packages every resulting mask as compact RLE so the whole set comes back as one manageable payload instead of a pile of separate mask images.
How it works
SAM itself doesn't ship with this pack - it's Meta's general-purpose segmentation model, the same one behind the point-click and text-prompted masking tools people use for background removal and object isolation, and the same one Impact Pack's detector providers build on. This node uses SAM's "segment everything" mode specifically, which is heavier than a single prompted segmentation because it's finding every object in the frame, not just the one region you asked about.
You need a SAM model loaded from somewhere else first - this node consumes a SAM_MODEL, it doesn't load one itself. The pack's README names two options: ComfyUI-Impact-Pack's SAMLoader, or comfyui_segment_anything's SAMModelLoader. If you specifically want an HQ (high-quality) SAM checkpoint, the README is explicit that you must use comfyui_segment_anything for that - Impact Pack's loader doesn't cover the HQ variants.
The inputs and outputs that matter
sam_model(SAM_MODEL) - from one of the two loaders above.image(IMAGE) - what to segment.output_mode(enum:uncompressed_rledefault, orcoco_rle) - the RLE flavor for the whole batch of masks, same choice as this pack'sMaskToRle.RLE_SEGS(STRING) - a single JSON bundle of every detected mask plus metadata. It's marked as an output node, so it also rides straight out in the run's API/websocket response without a separate save or preview step.
How to install it
The pack itself installs light - its own requirements.txt is glue code, nothing heavy. But actually running this node means setting up a second pack for the real SAM model (Impact Pack or comfyui_segment_anything) and downloading a real SAM checkpoint through that pack's own loader. Budget for that as a separate step:
cd ComfyUI/custom_nodes
git clone https://github.com/lldacing/comfyui-easyapi-nodes.git
cd comfyui-easyapi-nodes
pip install -r requirements.txt
Restart ComfyUI, then install whichever SAM loader pack you're using through Manager as normal.
Common issues & troubleshooting
It's slow and VRAM-hungry almost by definition. Auto-everything segmentation scans the whole image for every object rather than one prompted region, so expect it to take noticeably longer than a single SAM click. If it's too slow, too noisy, or missing things it should catch, SamAutoMaskSEGSAdvanced - same pack - exposes SAM's own tuning parameters instead of running at fixed defaults.
"No sam_model connected" traces back to the separate loader step above. This node has no fallback and won't load a checkpoint on its own - if that input is empty or disconnected, go check the Impact Pack or comfyui_segment_anything side of your graph first.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| sam_model | SAM_MODEL | — | |
| image | IMAGE | — | |
| output_mode | COMBO | uncompressed_rle | 2 options: uncompressed_rle, coco_rle |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| RLE_SEGS | STRING | — |