Nodes/comfyui_cv/CV Tuple
ComfyUI Node

CV Tuple

Authors one composite cv2 value - a Size (width, height), a Point (x, y), a 3-D point, a Rect - from typed number widgets, and emits it as ONE wire. Wire 'tuple' into any cv2 node's composite input (dsize, ksize, center, patternSize, winSize, ...): both components travel together, so a half-connected size is impossible. One instance can drive many nodes. 'array' is the same numbers as an NPARRAY vector, and 'literal' is the '(a, b)' string the few params that are still free-text literals take (and what a subgraph boundary can carry). This is also the way to set a composite input on a SUBGRAPH instance: a promoted input is a bare socket with no widget behind it.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Tuple
  • a
  • b
  • c
  • d
  • tuple
  • array
  • literal
count2
dtypeint
Categoryimage/CV/low-level

Inputs (6)

NameTypeDefaultDescription
countINT22–4How many components to emit: 2 for a Size / 2-D point, 3 for a 3-D point or an iteration-stop tuple, 4 for a Rect / Scalar.
dtypeCOMBOintComponent type. 'int' for pixel sizes, kernel sizes and pixel coordinates (cv2 rejects a float Size); 'float' for subpixel coordinates and world units.
aFLOAT,INT0-1e+38–1e+38First component - width / x. The socket takes an INT or a FLOAT link, so an image width and a subpixel coordinate both wire in directly.
bFLOAT,INT0-1e+38–1e+38Second component - height / y. Takes an INT or a FLOAT link.
coptFLOAT,INT0-1e+38–1e+38Third component (used when count >= 3) - z / width.
doptFLOAT,INT0-1e+38–1e+38Fourth component (used when count = 4) - height.

Outputs (3)

NameTypeDescription
tupleCV_TUPLEThe whole composite as one value - wire it into a cv2 node's composite input.
arrayNPARRAYThe same components as a 1-D NPARRAY vector, for the sockets that take an array (cv2.inRange bounds, arithmetic operands).
literalSTRINGThe '(a, b)' literal string, for the composite params that are still free-text (Scalar, RotatedRect, Moments) and for STRING subgraph boundaries.