Nodes/comfyui_cv/cv2.copyMakeBorder
ComfyUI Node

cv2.copyMakeBorder

Raw wrapper of cv2.copyMakeBorder(src, top, bottom, left, right, borderType, value?). 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.copyMakeBorder
  • src
  • result
top0
bottom0
left0
right0
borderTypeBORDER_DEFAULT
value
Categoryimage/CV/low-level/cv2 C

Inputs (7)

NameTypeDefaultDescription
srcCOMFY_MATCHTYPE_V3Source 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.
topINT0-2147483648–2147483647the top pixels
bottomINT0-2147483648–2147483647the bottom pixels
leftINT0-2147483648–2147483647the left pixels
rightINT0-2147483648–2147483647Parameter specifying how many pixels in each direction from the source image rectangle to extrapolate. For example, top=1, bottom=1, left=1, right=1 mean that 1 pixel-wide border needs to be built.
borderTypeCOMBOBORDER_DEFAULTBorder type. See borderInterpolate for details.
valueoptSTRINGBorder value if borderType==BORDER_CONSTANT . cv2 Scalar as a literal, e.g. "(0, 255, 0)" (BGR) or "(0, 255, 0, 64)" (BGRA). A bare number broadcasts to every component, so "255" means (255, 255, 255, 255). Components past the target's channel count are ignored by OpenCV. Leave blank for the OpenCV default.

Outputs (1)

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