Nodes/comfyui_cv/CV Cast Array
ComfyUI Node

CV Cast Array

Converts an ndarray to another element type, saturating like cv2.convertTo: values are rounded and clipped to the target range instead of wrapping around. cv2 arithmetic (add, multiply, compare...) refuses mixed types - e.g. int32 connected-component labels cannot be added to a uint8 mask without casting one side first.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Cast Array
  • nparray
  • nparray
dtypeuint8
Categoryimage/CV/low-level

Inputs (2)

NameTypeDefaultDescription
nparrayNPARRAYArray to convert; values survive, only the element type changes.
dtypeCOMBOuint8Target element type. Integer targets round and clip (saturate); float targets convert values as-is.

Outputs (1)

NameTypeDescription
nparrayNPARRAY