Plot Coordinates(PlotCoordinates)
This node implements plotting functionality based on the Matplotlib library, and the input coordinates must be formatted as a JSON string.
Plot Coordinates
The Plot Coordinates node implements plotting functionality based on the Matplotlib library. Input coordinates must be formatted JSON strings.
The Plot Coordinates node is a visualization tool capable of plotting a set of coordinate data into an image sequence. This node receives a list of coordinate points, marks these points as rectangular boxes on a specified canvas, and ultimately generates one or more images. Its core function is to transform abstract coordinate data into intuitive visual charts.
Node Functionality
This node implements plotting functionality based on the Matplotlib library. Input coordinates must be formatted JSON strings. It supports batch processing, generating a corresponding number of images based on the input coordinate count and combining them into a single image tensor output. Internally, the node draws a bounding box for each coordinate point and allows adjusting the box size via a multiplier.
Node Parameter Description - Plot Coordinates
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
coordinates | STRING | Yes | - | - | coordinates (Input Parameter): A JSON string containing coordinate points, formatted as [{"x": value, "y": value}, ...], used to specify the positions for drawing markers on the image. |
text | STRING | Yes | title | - | text (Input Parameter): Title text displayed on the generated image. Default value is "title", used to briefly describe the chart content. |
width | INT | Yes | 512 | 8 - 4096 (Step: 8) | width (Output Parameter): The width value of the output image, consistent with the input parameter. |
height | INT | Yes | 512 | 8 - 4096 (Step: 8) | height (Output Parameter): The height value of the output image, consistent with the input parameter. |
bbox_width | INT | Yes | 128 | 8 - 4096 (Step: 8) | bbox_width (Output Parameter): The width value of the output marker box, consistent with the input parameter. |
bbox_height | INT | Yes | 128 | 8 - 4096 (Step: 8) | bbox_height (Output Parameter): The height value of the output marker box, consistent with the input parameter. |
size_multiplier | FLOAT | No | [1.0] | 1.0 | - |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| images | IMAGE | images (Output Parameter): The output image tensor, containing the image sequence generated by plotting all coordinate points. |
| width | INT | width (Output Parameter): The width value of the output image, consistent with the input parameter. |
| height | INT | height (Output Parameter): The height value of the output image, consistent with the input parameter. |
| bbox_width | INT | bbox_width (Output Parameter): The width value of the output marker box, consistent with the input parameter. |
| bbox_height | INT | bbox_height (Output Parameter): The height value of the output marker box, consistent with the input parameter. |
Usage Scenarios
This node is very useful in workflows that require analyzing or displaying object positions within images. For example, in an object detection pipeline, the bounding box coordinates predicted by a model can be input into this node to quickly generate visualized result images with annotation boxes, used for intuitively verifying detection accuracy or for result demonstrations.
Notes
Ensure the input coordinate string format is correct during use; otherwise, parsing may fail. The generated image size and bounding box size are limited by the parameter ranges. Excessively large sizes may consume significant memory.
Plot Coordinates Node Source Code Link
The Plot Coordinates node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.