ComfyUI Node Runs on cloud

Points Editor

Click points and boxes onto an image for SAM and cropping

By kijai·Created 3 years ago·Updated about 12 hours ago· 2,930
Points Editor
  • bg_image
  • positive_coords
  • negative_coords
  • bbox
  • bbox_mask
  • cropped_image
points_store
coordinates
neg_coordinates
bbox_store
bboxes
bbox_format
width512
height512
normalizefalse

Some things are just easier to click than to type. Points Editor gives you a little canvas inside the node where you drop points and draw boxes directly on your image, and it turns those clicks into coordinates the rest of your workflow can use - most commonly to drive a segmentation model like SAM, or to crop a region out. Instead of guessing pixel coordinates and typing them into a text field, you point at the thing.

Fair warning up front, straight from the node itself: "WORK IN PROGRESS. Do not count on this as part of your workflow yet, probably contains lots of bugs and stability is not guaranteed!!" It lives in the experimental category for a reason. It's genuinely useful, and it's genuinely unfinished.

How it works

Select the node, then interact with its canvas:

  • Shift + click drops a positive (green) point.
  • Shift + right-click drops a negative (red) point.
  • Right-click a point deletes it.
  • Ctrl + click starts a bounding box; drag the corners to resize, drag the middle to move, right-click it to delete.

Positive and negative points are the native language of SAM-style segmentation: "include what's near the green dots, exclude what's near the red." You place a couple of green points on your subject, maybe a red one on the background you keep catching, and SAM segments accordingly. The bounding box gives you a region for cropping or box-based masking.

To load an image to click on, select the node and paste or drag one in, or feed the bg_image input (it grabs the first frame of a batch). One thing to know: the image is saved into the node and into your workflow metadata, so it travels with the graph - clear it from the right-click canvas menu if you don't want that.

Inputs and outputs

The inputs are mostly the stored state the canvas manages for you - coordinates, neg_coordinates, bboxes, and their _store companions, plus bbox_format (xyxy or xywh), width, height, and a normalize toggle for whether coordinates come out as 0–1 fractions or raw pixels. The optional bg_image is your backdrop.

What you wire onward are the five outputs:

  • positive_coords / negative_coords - your green and red points, as strings, for a SAM sampler.
  • bbox - the box, for crop or detection nodes.
  • bbox_mask - the box rendered as a mask.
  • cropped_image - the image cropped to your box, ready to go.

Installing it

Part of kijai's KJNodes pack.

  • ComfyUI Manager - search KJNodes for ComfyUI, install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r requirements.txt, and restart.

The node itself has no model download, but its main job is feeding a segmentation model, so you'll typically pair it with a SAM setup from another pack.

Common issues

Believe the WIP warning. If the canvas misbehaves, points don't register, or something desyncs after you edit the graph, that's the stability the author explicitly declined to guarantee - reload the node or the workflow before assuming you did something wrong.

The subtle gotcha is the embedded image. Because your clicked image is baked into the workflow metadata, sharing that workflow shares the image with it. If that's a photo you didn't mean to publish, clear it from the canvas menu before you export. And match bbox_format and normalize to whatever downstream node consumes the coordinates - an xyxy box handed to something expecting xywh, or pixel coords where fractions were wanted, is the usual reason the crop lands in the wrong place.

CategoryKJNodes/experimental

Inputs (10)

NameTypeDefaultDescription
points_storeSTRING
coordinatesSTRING
neg_coordinatesSTRING
bbox_storeSTRING
bboxesSTRING
bbox_formatCOMBO2 options: xyxy, xywh
widthINT5128–4096
heightINT5128–4096
normalizeBOOLEANfalse
bg_imageoptIMAGE

Outputs (5)

NameTypeDescription
positive_coordsSTRING
negative_coordsSTRING
bboxBBOX
bbox_maskMASK
cropped_imageIMAGE