GroundingDinoSAM2SegmentList
GroundingDino + SAM2 that hands you every mask, not just one
- sam_model
- grounding_dino_model
- image
- IMAGE
- MASKS
This node exists because of a GitHub issue that went stale. The normal GroundingDINO + SAM2 flow in ComfyUI is: type "person", get boxes, segment them, and get back one combined mask. That's fine until you want the mask for one specific person - and then the combined mask is useless. GroundingDinoSAM2SegmentList is the fork that changes the output: instead of merging everything, it returns the full list of masks, one per detected instance.
It ships inside SparknightLLC/ComfyUI-MaskArbiter as a modified copy of neverbiasu's ComfyUI-SAM2 node - the "List" suffix is the whole difference. The author wanted to upstream the list-output change and a SAM 2.1 fix, but the issues were auto-marked stale, so he's keeping the patched node in his own pack as of September 2025. That's why the README's honest about it: it's a stopgap, and you don't need it at all if you've moved to SAM 3.
How it works
It's the standard text-prompted segmentation pipeline, split into a reusable pair: GroundingDINO takes your prompt and turns it into bounding boxes (filtered by threshold, default 0.3), then SAM2 refines each box into a precise mask. The difference is in the plumbing - instead of one mask tensor, you get a Python list of masks in MASKS output, plus a matching IMAGE output that crops each detected object (background zeroed out). It also iterates over every image in a batch rather than just the first, which the upstream version didn't do well.
What is it for? Feeding the mask list into the pack's other node, Mask Arbiter, so you can say "give me the leftmost person's mask" or "the biggest face." That pairing is the reason this pack exists - check the example workflow image in the repo.
The inputs and outputs
The five required inputs:
sam_model(SAM2_MODEL) andgrounding_dino_model(GROUNDING_DINO_MODEL) - the model objects from ComfyUI-SAM2's loader nodes.image- whatever you're segmenting.prompt- the text description, plain English ("the person on the right").threshold- detection confidence cutoff. 0.3 is a sane start; if you're getting junk boxes, raise it, if you're getting nothing, lower it.
Outputs are IMAGE (per-instance crops as an image batch) and MASKS (the per-instance mask list) - wire MASKS into Mask Arbiter and the whole point of the node unlocks. If no detections survive the threshold, it returns a black mask and empty image rather than dying mid-batch.
Installing it
It comes with the pack, and the pack is one clone away:
cd ComfyUI/custom_nodes
git clone https://github.com/SparknightLLC/ComfyUI-MaskArbiter
or ComfyUI Manager → search "ComfyUI-MaskArbiter". The real dependency trap is models: this node only defines the segmenting half. The SAM2_MODEL and GROUNDING_DINO_MODEL types it takes as input are registered by ComfyUI-SAM2, so you need that pack installed too, along with its model downloads (a SAM2 checkpoint plus GroundingDINO weights, fetched through its loader nodes). Plan on two custom nodes, not one.
Common issues
- "No node found for type SAM2_MODEL" when you load a workflow - you're missing ComfyUI-SAM2, not this pack. Install it via Manager, then use its
Load SAM2 ModelandLoad GroundingDINO Modelnodes. - Masks for "everyone" instead of your target - this is GroundingDINO being a detector, not a reasoner. Phrase the prompt precisely ("the woman with blonde hair" beats "woman") and lean on
threshold. - Empty/black output - no boxes cleared the threshold. Drop the threshold a notch or check the image isn't being fed in at weird resolution.
It's a small, purpose-built fork, and if you're doing per-object masking it's the missing link between "detect things" and "mask the thing I actually meant."
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| sam_model | SAM2_MODEL | — | |
| grounding_dino_model | GROUNDING_DINO_MODEL | — | |
| image | IMAGE | — | |
| prompt | STRING | — | |
| threshold | FLOAT | 0.300–1 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASKS | MASKS | — |