Points Editor(PointsEditor)
This node supports two types of coordinate points (positive and negative) and two bounding box formats (xyxy and xywh).
Points Editor
The Points Editor node supports two types of coordinate points (positive and negative) and two bounding box formats (xyxy and xywh).
The Points Editor is a graphical tool node for interactively creating and editing coordinate points on an image. It allows users to mark areas of interest through click operations and generates corresponding coordinate data, providing precise location information for subsequent image processing steps.
Interactive Controls
- Shift + click to add a positive (green) point.
- Shift + right click to add a negative (red) point.
- Right click on a point to delete it.
- Ctrl + click to draw a bounding box.
- Drag bbox corners to resize, drag inside to move.
- Right click on bbox to delete it.
- To add an image, select the node and copy/paste or drag in the image, or provide it via the
bg_imageinput (first frame of the batch).
Node Functionality
This node supports two types of coordinate points (positive and negative) and two bounding box formats (xyxy and xywh). Its core mechanism involves receiving user mouse operations through a built-in graphical interface, converting click positions into coordinate data, and outputting this data as strings or structured formats (such as bounding boxes, masks) for use by other nodes in the workflow.
Node Parameter Description - Points Editor
Connection Inputs (Inputs)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
bg_image | IMAGE | No | - | - | bg_image (Input Parameter): An optional parameter used to load a background image into the editor as a drawing reference. |
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
bbox_format | COMBO | Yes | xyxy | "xyxy", "xywh", "" | bbox_format (Input Parameter): Selects the coordinate format for bounding boxes. Options are "xyxy" (top-left x, y, bottom-right x, y) or "xywh" (top-left x, y, width, height). |
points_store | STRING | Yes | - | - | points_store (Input Parameter): A string field used for internal storage and management of positive coordinate point data. |
coordinates | STRING | Yes | - | - | coordinates (Input Parameter): Input or receive an existing string of positive coordinate points, typically in the format "x1,y1;x2,y2". |
neg_coordinates | STRING | Yes | - | - | neg_coordinates (Input Parameter): Input or receive an existing string of negative coordinate points, typically in the format "x1,y1;x2,y2". |
bbox_store | STRING | Yes | - | - | bbox_store (Input Parameter): A string field used for internal storage and management of bounding box data. |
bboxes | STRING | Yes | - | - | bboxes (Input Parameter): Input or receive an existing string of bounding box coordinates. |
width | INT | Yes | 512 | 8 - 4096 (Step: 8) | width (Input Parameter): Defines the width of the editor canvas and the output coordinate reference system. Range is 8 to 4096, adjustable in steps of 8. |
height | INT | Yes | 512 | 8 - 4096 (Step: 8) | height (Input Parameter): Defines the height of the editor canvas and the output coordinate reference system. Range is 8 to 4096, adjustable in steps of 8. |
normalize | BOOLEAN | Yes | False | - | normalize (Input Parameter): Controls whether to normalize the output coordinate values to the range 0-1. |
Outputs
| Parameter Name | Data Type | Description |
|---|---|---|
| positive_coords | STRING | positive_coords (Output Parameter): Outputs a string containing all positive (green) coordinate points. |
| negative_coords | STRING | negative_coords (Output Parameter): Outputs a string containing all negative (red) coordinate points. |
| bbox | BBOX | bbox (Output Parameter): Outputs the user-drawn bounding box data. |
| bbox_mask | MASK | bbox_mask (Output Parameter): Outputs a black-and-white mask image corresponding to the bounding box. |
| cropped_image | IMAGE | cropped_image (Output Parameter): Outputs the image region cropped according to the bounding box. |
Usage Scenarios
In image inpainting or local redrawing workflows, you can use this node to precisely mark areas that need modification (positive points) and areas that need protection (negative points) on a background image. The generated coordinates and bounding boxes can be directly connected to sampler or mask processing nodes to guide the AI to draw only on specified areas.
Notes
WORK IN PROGRESS: Do not count on this node as part of your workflow yet. It probably contains lots of bugs and stability is not guaranteed!! Background images loaded into the node are saved to the node and workflow metadata. They can be removed by right-clicking on the canvas and selecting "Clear Image" from the context menu.
Points Editor Node Source Code Link
The Points Editor node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.