Nodes/comfyui_cv/cv2.resize
ComfyUI Node

cv2.resize

Raw wrapper of cv2.resize(src, dsize, fx?, fy?, interpolation?). Parameters marked '?' are optional; blank means OpenCV default. See the OpenCV documentation for details.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
cv2.resize
  • src
  • dsize
  • result
fx0.0000
fy0.0000
interpolationINTER_LINEAR
Categoryimage/CV/low-level/cv2 R

Inputs (5)

NameTypeDefaultDescription
srcCOMFY_MATCHTYPE_V3input image. The image output(s) echo this input's format. A LATENT link is processed in latent space: frame 0 becomes a float32 [H,W,C] array (any channel count), values untouched. Arithmetic ops (add, multiply, etc.) also accept a full LATENT batch ({samples: [B,C,H,W]}) — the whole batch flows through when both inputs have the same batch size. 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.
dsizeCV_TUPLE0,0output image size; if it equals zero (`None` in Python), it is computed as: $$\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}$$ Either dsize or both fx and fy must be non-zero. One value with 2 components (w, h) - it travels as a whole, so it cannot arrive half-connected. Wire it from 'CV Tuple' or type the components in place.
fxoptFLOAT0.0000-1e+38–1e+38scale factor along the horizontal axis; when it equals 0, it is computed as $$\texttt{(double)dsize.width/src.cols}$$ Preset to the OpenCV default (0.0).
fyoptFLOAT0.0000-1e+38–1e+38scale factor along the vertical axis; when it equals 0, it is computed as $$\texttt{(double)dsize.height/src.rows}$$ Preset to the OpenCV default (0.0).
interpolationoptCOMBOINTER_LINEARinterpolation method, see #InterpolationFlags

Outputs (1)

NameTypeDescription
resultCOMFY_MATCHTYPE_V3Echoes the 'src' input's format: an IMAGE link comes back as IMAGE, MASK as MASK, NPARRAY stays NPARRAY.