ComfyUI Node
CV Reshape Array
Reinterprets an ndarray's shape without touching its values (numpy reshape). The main use: fold a flat per-sample vector back into a 2-D grid - e.g. the query predictions of 'CV Train Classifier' over an 'CV Coordinate Grid' become a (rows, cols) label image ready for a colormap. 0 infers that dimension from the element count (at most one of rows/cols may be 0). channels > 0 appends a third axis. Raises when the element count does not fit the requested shape - that is a wiring mistake, not data.
CV Reshape Array
- nparray
- nparray
◄rows0►
◄cols0►
◄channels0►
Categoryimage/CV/low-level
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| nparray | NPARRAY | Array to reshape; the element count must match rows * cols (* channels). | |
| rows | INT | 00–2147483647 | Target row count (height). 0 = infer from the element count and the other dimensions. |
| cols | INT | 00–2147483647 | Target column count (width). 0 = infer. |
| channelsopt | INT | 00–512 | Optional third axis size (e.g. 2 for point pairs, 3 for color). 0 = no channel axis. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | The same values in the new shape. |