Nodes/ComfyUI-SAM3/SAM3 Combine Points
ComfyUI Node

SAM3 Combine Points

Merge single points into one prompt SAM3 accepts

By PozzettiAndrea·Created 9 months ago·Updated 27 days ago· 557
SAM3 Combine Points
  • point_1
  • point_2
  • point_3
  • point_4
  • point_5
  • point_6
  • point_7
  • point_8
  • point_9
  • point_10
  • points_prompt

The glue between Create Point and the actual segmentation. SAM3 Create Point emits a single SAM3_POINT_PROMPT, but the segmentation nodes want the plural SAM3_POINTS_PROMPT - a set. This node bridges that gap: plug in up to ten individual points and it merges them into the one bundle SAM3 can segment from. It's small and unglamorous, but without it your numerically-built points have nowhere to go.

Why you'd need several points bundled: point-based segmentation gets good when you give it more than one hint. A positive point on the object, another on a different part of it, a negative point on the background it keeps grabbing - that combination is what turns a vague mask into a clean one. This node is where you assemble that combination when you're building points by number rather than clicking.

How it works

It has ten optional inputs, point_1 through point_10, each taking one SAM3_POINT_PROMPT. Wire in as many as you've got - one, three, all ten - and it collects them into a single SAM3_POINTS_PROMPT. Each point keeps its own foreground/background flag, so a single bundle can carry both include and exclude hints together. Empty inputs are simply ignored.

The inputs and outputs that matter

  • point_1point_10 (all optional, type SAM3_POINT_PROMPT) - the individual points to merge, each from a SAM3 Create Point node. Fill as few or as many as you need.

Output is points_prompt (SAM3_POINTS_PROMPT) - wire it into the positive_points input of SAM3 Point Segmentation, or into SAM3 Video Segmentation when it's in point mode. This is the type those nodes actually accept.

A note on include vs exclude: since each point carries its own foreground flag from Create Point, you can bundle positives and negatives here, but check how your segmentation node splits them - some setups keep positive and negative points on separate inputs (as the Point Collector does with its two outputs). Match the wiring to how your prompt was flagged.

How to install it

Comes 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. sam3.pt goes in ComfyUI/models/sam3/ for the segmentation nodes. The README notes an experimental comfy-env/pixi one-click installer.

Common issues & troubleshooting

Segmentation node won't take my Create Point output directly. That's exactly what this node fixes. Create Point gives a singular SAM3_POINT_PROMPT; the segmentation node wants the plural SAM3_POINTS_PROMPT. Route your points through here first - even a single point needs this to change type.

All inputs are optional - is that a bug? No. You can leave any of the ten unconnected; only the wired points get merged. It's fine to use just point_1 if that's all you have, though one point makes a weak prompt.

The mask ignores my negative points. Confirm those points were flagged as background (is_foreground off) back in Create Point, and that your segmentation node reads negatives from where you wired them. A negative point that's still flagged foreground just adds another include hint.

Would clicking be easier? For hand work, yes - SAM3 Point Collector lets you click straight on the image and skips this whole Create-then-Combine assembly. This path is for when points are generated numerically.

CategorySAM3/prompts

Inputs (10)

NameTypeDefaultDescription
point_1optSAM3_POINT_PROMPTConnect point prompts from SAM3CreatePoint nodes. Combines multiple points into a single prompt for SAM3Segmentation.
point_2optSAM3_POINT_PROMPTConnect point prompts from SAM3CreatePoint nodes. Combines multiple points into a single prompt for SAM3Segmentation.
point_3optSAM3_POINT_PROMPTConnect point prompts from SAM3CreatePoint nodes. Combines multiple points into a single prompt for SAM3Segmentation.
point_4optSAM3_POINT_PROMPTConnect point prompts from SAM3CreatePoint nodes. Combines multiple points into a single prompt for SAM3Segmentation.
point_5optSAM3_POINT_PROMPTConnect point prompts from SAM3CreatePoint nodes. Combines multiple points into a single prompt for SAM3Segmentation.
point_6optSAM3_POINT_PROMPTConnect point prompts from SAM3CreatePoint nodes. Combines multiple points into a single prompt for SAM3Segmentation.
point_7optSAM3_POINT_PROMPTConnect point prompts from SAM3CreatePoint nodes. Combines multiple points into a single prompt for SAM3Segmentation.
point_8optSAM3_POINT_PROMPTConnect point prompts from SAM3CreatePoint nodes. Combines multiple points into a single prompt for SAM3Segmentation.
point_9optSAM3_POINT_PROMPTConnect point prompts from SAM3CreatePoint nodes. Combines multiple points into a single prompt for SAM3Segmentation.
point_10optSAM3_POINT_PROMPTConnect point prompts from SAM3CreatePoint nodes. Combines multiple points into a single prompt for SAM3Segmentation.

Outputs (1)

NameTypeDescription
points_promptSAM3_POINTS_PROMPT