KJNodes/experimentalgenerated

Points Editor(PointsEditor)

This node supports two types of coordinate points (positive and negative) and two bounding box formats (xyxy and xywh).

Points Editor

bg_image
positive_coords
negative_coords
bbox
bbox_mask
cropped_image
points_store
STRING
coordinates
STRING
neg_coordinates
STRING
bbox_store
STRING
bboxes
STRING
bbox_format
COMBO
width
512
height
512
normalize
KJNodes

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_image input (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 NameData TypeRequiredDefault ValueRange/OptionsDescription
bg_imageIMAGENo--bg_image (Input Parameter): An optional parameter used to load a background image into the editor as a drawing reference.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
bbox_formatCOMBOYesxyxy"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_storeSTRINGYes--points_store (Input Parameter): A string field used for internal storage and management of positive coordinate point data.
coordinatesSTRINGYes--coordinates (Input Parameter): Input or receive an existing string of positive coordinate points, typically in the format "x1,y1;x2,y2".
neg_coordinatesSTRINGYes--neg_coordinates (Input Parameter): Input or receive an existing string of negative coordinate points, typically in the format "x1,y1;x2,y2".
bbox_storeSTRINGYes--bbox_store (Input Parameter): A string field used for internal storage and management of bounding box data.
bboxesSTRINGYes--bboxes (Input Parameter): Input or receive an existing string of bounding box coordinates.
widthINTYes5128 - 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.
heightINTYes5128 - 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.
normalizeBOOLEANYesFalse-normalize (Input Parameter): Controls whether to normalize the output coordinate values to the range 0-1.

Outputs

Parameter NameData TypeDescription
positive_coordsSTRINGpositive_coords (Output Parameter): Outputs a string containing all positive (green) coordinate points.
negative_coordsSTRINGnegative_coords (Output Parameter): Outputs a string containing all negative (red) coordinate points.
bboxBBOXbbox (Output Parameter): Outputs the user-drawn bounding box data.
bbox_maskMASKbbox_mask (Output Parameter): Outputs a black-and-white mask image corresponding to the bounding box.
cropped_imageIMAGEcropped_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.

The Points Editor node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…