ComfyUI Node
CV Plot 2D (cv2.plot)
Renders one series of numbers as a line/point plot IMAGE using cv2.plot.Plot2d - OpenCV's own plotting module. Because the result is an ordinary IMAGE it saves, composites and diffs like any other: this is the node for putting a curve INTO a picture (a report sheet, a video frame, a saved PNG). Feed a 1-D array (plotted against its index) or an (N, 2) array of x, y pairs; x_values overrides the x axis. Plot2d draws ONE series with no labels or legend - for several series, category names, tooltips or a threshold line use 'CV Chart Series' instead. Empty input renders an empty plot rather than failing.
CV Plot 2D (cv2.plot)
- values
- x_values
- plot
◄width640►
◄height400►
◄drawline►
◄line_width1►
◄show_gridtrue►
◄grid_lines10►
◄show_texttrue►
◄value_rangeauto (data range)►
◄min_x0.00►
◄max_x1.00►
◄min_y0.00►
◄max_y1.00►
◄line_color(0, 255, 0)►
◄background_color(30, 30, 30)►
◄axis_color(200, 200, 200)►
◄grid_color(70, 70, 70)►
◄text_color(230, 230, 230)►
◄print_point_index-1►
◄y_downfalse►
Categoryimage/CV/plots
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| values | NPARRAY | The numbers to plot: 1-D (or (N, 1) / (1, N)) is plotted against the sample index; an (N, 2) array is read as x, y pairs. Converted to float64, which is the only dtype Plot2d accepts. Larger values are drawn UPWARDS (see y_down). | |
| width | INT | 640400–4096 | Plot width in pixels. cv2.plot CLAMPS anything below 400 up to 400 - that is the module, not this node. |
| height | INT | 400300–4096 | Plot height in pixels; clamped up to 300 minimum by cv2.plot itself. |
| draw | COMBO | line | 'line' connects consecutive samples; 'points only' marks them without the connecting segments - the honest choice when the samples are independent measurements rather than a signal. |
| x_valuesopt | NPARRAY | Optional x coordinate per sample (same length as values). Without it samples are plotted against their index. Ignored when values is (N, 2). | |
| line_widthopt | INT | 11–16 | Stroke width of the plotted line in pixels. |
| show_gridopt | BOOLEAN | true | Draw the background grid. |
| grid_linesopt | INT | 101–100 | Number of grid divisions when the grid is shown. |
| show_textopt | BOOLEAN | true | Draw the axis value texts (the min/max readouts cv2.plot prints along the axes). |
| value_rangeopt | COMBO | auto (data range) | 'auto' lets Plot2d fit the axes to the data - which hides how big the values are in absolute terms. 'manual' pins the axes so two plots of different runs are comparable. |
| min_xopt | FLOAT | 0.00-1000000000–1000000000 | Left edge of the x axis ('manual' range only). |
| max_xopt | FLOAT | 1.00-1000000000–1000000000 | Right edge of the x axis ('manual' range only). |
| min_yopt | FLOAT | 0.00-1000000000–1000000000 | Bottom of the y axis ('manual' range only). |
| max_yopt | FLOAT | 1.00-1000000000–1000000000 | Top of the y axis ('manual' range only). |
| line_coloropt | STRING | (0, 255, 0) | Series color as a BGR tuple, e.g. '(0, 255, 0)'. |
| background_coloropt | STRING | (30, 30, 30) | Plot background color, BGR. |
| axis_coloropt | STRING | (200, 200, 200) | Axis line color, BGR. |
| grid_coloropt | STRING | (70, 70, 70) | Grid line color, BGR. |
| text_coloropt | STRING | (230, 230, 230) | Axis text color, BGR. |
| print_point_indexopt | INT | -1-1–1000000 | Prints the value of ONE sample onto the plot: the index to annotate, or -1 for none. Useful to call out the winner of a comparison. |
| y_downopt | BOOLEAN | false | Flips the y axis so larger values go DOWN, matching image coordinates (or a cost/error where lower is better). Off - the default - draws larger values UP, like 'CV Chart Series' and every other plot. Note this is the OPPOSITE of raw cv2.plot, whose own default draws downward; the node corrects it. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| plot | IMAGE | The rendered plot as a normal IMAGE (BGR converted to ComfyUI RGB), ready for Save Image, compositing or stacking next to the data it describes. |