小珠光点编辑器
Click points on your image and hand them straight to SAM
- image
- positive_coords
- negative_coords
- bbox
- frame_index
Segment Anything workflows run on clicks: one dot on the thing you want, one dot on the thing you don't, and SAM figures out the mask. The fiddly part is always getting those coordinates out of the image and into a SAM node's expected format. XiaozhuguangPointsEditor (小珠光点编辑器) is the pack's visual answer - you see the image on the node, click to drop positive and negative points, drag a box if you want, and it emits the coordinates as JSON your downstream SAM node can consume.
Mechanically it's a canvas-over-image node. The image input lands on the node and you annotate directly on it: positive points, negative points, and a bounding box. The coordinates get serialized to JSON and pushed out. The one setting worth knowing is preview_pixels - it caps the preview's pixel budget so a 4K frame doesn't turn the node into a slideshow. Default is 100 (meaning ~1 megapixel: images bigger than that get downscaled for display). Coordinates are then scaled back up to the original image's coordinate space before they leave the node, so your annotated points land on the right pixels no matter how small the preview was. Set it to 0 and it never scales, if you want pixel-exact clicking on a smaller image. The pack's changelog also mentions the preview is cached offscreen so dragging points around on long, high-res images stays smooth - a real usability upgrade over the typical "annotate on a frozen thumbnail" nodes.
Inputs:
- image - the frame(s) you're annotating.
- info - a JSON string that can carry annotations back in (handy for round-tripping points you saved earlier).
- preview_pixels - display-size budget for the preview, as described above.
Outputs:
- positive_coords - JSON list of
{x, y}points for what you want segmented. - negative_coords - JSON list of points for what you don't want.
- bbox - your drawn bounding box(es), emitted as box coordinates.
- frame_index - which frame of a multi-frame input you annotated, so the coords stay attached to the right frame.
The standard shape is: this node → a SAM node that takes points (many SAM implementations read the JSON these emit) → mask → whatever you're doing with the mask. It's also an output node, so you can run just the annotation and inspect the coordinates as plain text. For multi-frame video you can annotate a specific frame and the frame_index output keeps the plumbing honest.
The honest take: if you already live in a SAM-focused pack, that pack's own point editor is probably as good and needs no extra install. This one earns its place if you're in the Xiaozhuguang ecosystem or you want the scale-aware coordinate round-trip - the preview-caps-then-rescales behavior is genuinely nicer than guessing coordinates blind on a 4000px image.
Install: ComfyUI Manager → ComfyUI-xiaozhuguang → restart, or git clone https://github.com/xiaozhuguang/ComfyUI-xiaozhuguang into custom_nodes. No models, no dependencies. It's a small node that solves the unglamorous but real problem of "how do my clicks become SAM's inputs," and for that job it's pleasant to use.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| info | STRING | — | |
| preview_pixelsopt | INT | 1000–10000 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| positive_coords | STRING | — |
| negative_coords | STRING | — |
| bbox | STRING | — |
| frame_index | INT | — |