Nodes/comfyui_cv/⚠️ CV ZeroStride Like
ComfyUI Node

⚠️ CV ZeroStride Like

DANGER: this node emits a 0-STRIDE BROADCAST VIEW, not a real filled array. Outputs ONE backing element broadcast to the input's width/height (and channels), so it allocates almost nothing - the point is to skip allocating a full canvas that cv2 will immediately overwrite. It is ONLY safe as the `dst` of a cv2 node that writes its result into the array in place (cv2.randu, cv2.randn, cv2.accumulate, the drawing primitives, ...). NEVER use the output as a source image, mask, for previews, or convert it to a tensor: those read every element and will error or yield garbage (every row/column identical). The low-level wrapper copies it into a real contiguous array before cv2 runs, so cv2 always receives a legitimate array - the saving is only this node's own allocation.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
⚠️ CV ZeroStride Like
  • nparray
  • nparray
value0.00
channelsgrayscale (single channel)
dtypeuint8
Categoryimage/CV/features

Inputs (4)

NameTypeDefaultDescription
nparrayNPARRAY,IMAGE,MASKOnly its width/height (and channels, if 'same as input') and dtype (if dtype is 'same as input') are used to size the broadcast view. 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.
valueFLOAT0.00DANGER: this node emits a 0-STRIDE BROADCAST VIEW, not a real filled array. The single backing value broadcast to every pixel. cv2 overwrites it, so this only sets the view's dtype/shape, not the eventual content.
channelsCOMBOgrayscale (single channel)Mirrors CV Constant Like: single-channel, or replicate the input's channel count.
dtypeCOMBOuint8Element type of the view. 'same as input' takes the input array's dtype; otherwise pick an explicit one (uint8 matches CV Constant Like).

Outputs (1)

NameTypeDescription
nparrayNPARRAYDANGER: this node emits a 0-STRIDE BROADCAST VIEW, not a real filled array. 0-stride broadcast VIEW. Safe only as a cv2 dst that is overwritten. Not a normal array - do not read it as one.