ComfyUI-KJNodes
Run ComfyUI Easily with InstaSD
Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:
- One-click deployment
- Any model, any node
- Powerful GPUs for rapid iteration
Available Nodes
PointsEditor
PointsEditor Node Documentation
Overview
The PointsEditor node is an experimental feature in the ComfyUI-KJNodes package. It provides a graphical interface for creating, editing, and managing coordinates and bounding boxes within the ComfyUI environment. This node is a part of KJNodes' ongoing development and may undergo changes, which can affect its stability.
Functionality
The PointsEditor node allows users to:
- Create and manage sets of positive and negative coordinate points.
- Draw and edit bounding boxes on images.
- Normalize coordinate values based on the specified width and height.
- Export resulting data, including masks and cropped images, for further use in workflows.
- Load and display an image as a background for editing, which is stored in the node and workflow metadata.
Inputs
The PointsEditor node accepts the following inputs:
-
points_store:
- Type: String
- A reference string for storing positive points data.
-
coordinates:
- Type: String
- A JSON-formatted string representing the positive coordinates to manage.
-
neg_coordinates:
- Type: String
- A JSON-formatted string representing negative coordinates.
-
bbox_store:
- Type: String
- A reference string for storing bounding box data.
-
bboxes:
- Type: String
- A JSON-formatted string representing bounding boxes.
-
bbox_format:
- Type: List Selection
- Options: 'xyxy' or 'xywh'
- Specifies the format for bounding boxes, either as corner coordinates or as width-height format.
-
width:
- Type: Integer
- Default: 512
- Specifies the width of the editing canvas.
-
height:
- Type: Integer
- Default: 512
- Specifies the height of the editing canvas.
-
normalize:
- Type: Boolean
- Default: False
- Whether to normalize coordinates to a range of 0 to 1 based on the canvas dimensions.
-
bg_image:
- Type: Image (Optional)
- An optional background image to aid in identifying coordinates and bounding areas.
Outputs
The PointsEditor node provides the following outputs:
-
positive_coords:
- Type: String
- JSON-formatted string of positive coordinates.
-
negative_coords:
- Type: String
- JSON-formatted string of negative coordinates.
-
bbox:
- Type: Bounding Box
- Bounding box data in the selected format.
-
bbox_mask:
- Type: Mask
- A mask tensor highlighting the areas within the specified bounding boxes.
-
cropped_image:
- Type: Image
- An image cropped to the first bounding box if available; otherwise, outputs the provided background image.
Usage in ComfyUI Workflows
The PointsEditor node can be utilized in workflows where precise image manipulation and annotation are required. For instance, it is helpful in:
- Image processing and annotation tasks, where specific regions of interest need to be marked and manipulated.
- Developing custom transformations, where areas delineated by coordinates and bounding boxes undergo specific operations.
- Automated workflows that involve masking or applying effects to precise areas of images in batch processes.
Special Features and Considerations
- Graphical Interface: Allows for the interactive addition and modification of points and boxes directly within the ComfyUI environment.
- In-Metadata Image Storage: The image added to the node remains stored, aiding the persistence of visual references through workflow sessions.
- Normalization Option: Proper usability for adaptable workflows where scaling is a factor, ensuring coordinates maintain proportionality.
- BBox Editing: Flexibility in bounding box formats allows users to configure data to fit the workflow's requirements.
- Work In Progress: This node is experimental, indicating the potential for extensive future updates, bug fixes, and feature enhancements.
Overall, the PointsEditor node empowers users with a versatile and interactive tool for managing and processing coordinate-based image data within ComfyUI's versatile workflow automation capabilities.