TBG SAM3 Selector
The interactive selector for SAM3
- image
- sam3_selectors_pipe
TBG SAM3 Selector is the node you actually touch. The segmentation node behind it is where the work happens, but this is the one that shows your image and lets you draw the boxes and points that tell SAM3 what you mean. It's the pack's interactive prompt collector: you click on the image in the node preview, and it builds the normalized prompt pipeline the segmentation nodes consume.
What it actually is
A ComfyUI output node with a custom web widget (sam3_points_boxes_widget.js in the pack). It displays your image, and the widget translates mouse clicks into the four JSON string fields you can see on the node. The author's tooltip is the whole instruction manual: "Use B to toggle Point/Box. Left=Positive, Right/Shift=Negative." So left-click to mark something you want, right-click (or Shift-click) for things SAM3 should avoid, and B flips between drawing a point and dragging out a box.
It's unified where older SAM2-style selectors split point selection and box selection across separate nodes. Here everything - positive and negative points, positive and negative boxes - lands in one place, and the node's job is to normalize it into a reusable SAM3_PROMPT_PIPELINE.
The inputs and output
The four JSON string inputs (positive_points, negative_points, positive_boxes, negative_boxes) start as "[]" and get filled in by the widget as you draw. You can hand-write them - they're just JSON arrays of {x, y} objects for points and {x1, y1, x2, y2} objects for boxes - but that's mostly a curiosity; the widget exists so you don't have to.
Under the hood, collect_pipeline parses those arrays and normalizes them to SAM3's expected format: points become 0–1 coordinates, boxes become center/width/height. It also base64-encodes the image back to the UI so the widget can render it as a background. Output is sam3_selectors_pipe (SAM3_PROMPT_PIPELINE), which you wire into TBG SAM3 Segmentation or TBG SAM3 Batch Selector's sam3_selectors_pipe input.
Installing
Same pack install as everything here: ComfyUI Manager (search "TBG-SAM3"), or clone the repo into custom_nodes and pip install -r requirements.txt. There's nothing model-specific about this node - it doesn't touch the checkpoint at all - but you'll need the loader nodes and the gated SAM3 model before the rest of the chain works.
Where people get burned
- The controls aren't obvious. If you click and nothing seems to happen, remember it's B to switch point/box mode, left is positive, right/Shift is negative. The widget is the surface for all of it.
- It's an output node. It appears in the graph like a terminal node, but it still feeds its pipeline onward. Don't unplug it thinking it's a preview-only utility.
- It feeds the wrong thing.
sam3_selectors_pipeis a SAM3-specific type - it goes into this pack's segmentation nodes, not into Impact Pack or anything expecting SEGS. The SEGS conversion happens after segmentation, not here.
It's a small node with a narrow job, but it's the difference between SAM3 being a text-only segmenter and actually being able to point at the object in the picture. For interactive work - "this cat, not that one" - it's the piece that makes the pack feel like a pointer rather than a lottery.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image for interactive selection. Use B to toggle Point/Box. Left=Positive, Right/Shift=Negative. | |
| positive_points | STRING | [] | — |
| negative_points | STRING | [] | — |
| positive_boxes | STRING | [] | — |
| negative_boxes | STRING | [] | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| sam3_selectors_pipe | SAM3_PROMPT_PIPELINE | — |