Nodes/comfyui_cv/CV Array Shape
ComfyUI Node

CV Array Shape

Reads the spatial dimensions and channel count of an IMAGE/MASK/LATENT/NPARRAY. For a [H,W] array or MASK channels=1; for [H,W,C] arrays channels=C. LATENT sizes count latent cells (pixels / VAE stride). Only the shape is inspected - no data is read or modified.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Array Shape
  • nparray
  • height
  • width
  • channels
  • dsize
  • size
Categoryimage/CV/low-level

Inputs (1)

NameTypeDefaultDescription
nparrayNPARRAY,IMAGE,MASK,LATENTArray whose shape to read. Only the shape is inspected regardless of dtype. LATENT sizes count latent cells. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size.

Outputs (5)

NameTypeDescription
heightINTHeight (first spatial dimension). For LATENT inputs this counts latent cells (pixels / stride).
widthINTWidth (second spatial dimension). For LATENT inputs this counts latent cells.
channelsINTNumber of channels: 1 for 2-D arrays / MASK, C for [H,W,C] arrays / IMAGE / LATENT.
dsizeSTRING'(width, height)' literal, for the composite cv2 params that are still free-text. Prefer the 'size' output for a Size-typed input.
sizeCV_TUPLE(width, height) as ONE composite value - wire it straight into a cv2 node's dsize / ksize / winSize / imageSize input. Both components travel together, so the size can never arrive half-connected.