Nodes/comfyui_cv/CV Reshape Array
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.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Reshape Array
  • nparray
  • nparray
rows0
cols0
channels0
Categoryimage/CV/low-level

Inputs (4)

NameTypeDefaultDescription
nparrayNPARRAYArray to reshape; the element count must match rows * cols (* channels).
rowsINT00–2147483647Target row count (height). 0 = infer from the element count and the other dimensions.
colsINT00–2147483647Target column count (width). 0 = infer.
channelsoptINT00–512Optional third axis size (e.g. 2 for point pairs, 3 for color). 0 = no channel axis.

Outputs (1)

NameTypeDescription
nparrayNPARRAYThe same values in the new shape.