SAM3 Multi-Region Collector π―
Mark several objects for one multiprompt pass
- image
- multi_prompts
This is the front end for batch segmentation. Where the Point Collector marks one object, the Multi-Region Collector lets you mark several distinct regions on the same image and bundles them into the single SAM3_MULTI_PROMPTS package that SAM3 Multiprompt Segmentation eats in one pass. So it's the "I want the head and the hands and the jacket, each as its own mask" node - you define all the regions here, then one segmentation call returns a mask for each.
It's the interactive setup for the multi-object workflow, and it's the only sensible way to build a SAM3_MULTI_PROMPTS bundle. Without it you'd be wiring parallel segmentation branches; with it the whole multi-region job collapses into two nodes.
How it works
You mark multiple regions on the node's image canvas - each region a separate prompt - and it stores the lot and emits one SAM3_MULTI_PROMPTS output containing them all. It's an output node, so the interactive canvas renders right in the graph. Each region keeps its own identity, which is how the downstream node can return a separate mask per region instead of one merged blob.
The inputs and outputs that matter
image(IMAGE) - the picture you mark up. Required; the canvas needs it.multi_prompts_store- the stored region data (defaults to[]). The interactive editor writes this as you add regions; you don't hand-edit it.
Output is a single multi_prompts (SAM3_MULTI_PROMPTS) - wire it straight into the multi_prompts input of SAM3 Multiprompt Segmentation. That node is the only consumer of this type, so this pairing is fixed: collector out, multiprompt segmentation in.
How to install it
Ships with the pack. Manager: search SAM3, install the highest version. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/PozzettiAndrea/ComfyUI-SAM3.git
cd ComfyUI-SAM3
pip install -r requirements.txt --upgrade
python install.py
then restart, with sam3.pt in ComfyUI/models/sam3/ for the segmentation step. The README flags an experimental comfy-env/pixi one-click install.
Common issues & troubleshooting
Canvas is blank. Connect an image and run once so the collector has the picture to mark on.
Regions bleed into each other in the result. That's usually because the regions were marked too loosely or too close together. Keep each region's marks clearly inside its own object; if two objects genuinely touch, expect their masks to touch too.
Downstream node rejects the connection. multi_prompts only fits SAM3 Multiprompt Segmentation. It won't plug into single-object segmentation nodes - those want SAM3_POINTS_PROMPT or SAM3_BOXES_PROMPT, not this bundle.
Only one region came back. Make sure you actually committed more than one region in the editor before running - an empty or single-entry store gives you one mask. The whole point is to define several up front.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image to display in interactive canvas. Click to add points, Shift+drag to draw boxes. Use tab bar to manage multiple prompt regions. | |
| multi_prompts_store | STRING | [] | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| multi_prompts | SAM3_MULTI_PROMPTS | β |