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.
cv2.copyMakeBorder
- src
- result
◄top0►
◄bottom0►
◄left0►
◄right0►
◄borderTypeBORDER_DEFAULT►
◄value►
Categoryimage/CV/low-level/cv2 C
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| src | COMFY_MATCHTYPE_V3 | Source 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. | |
| top | INT | 0-2147483648–2147483647 | the top pixels |
| bottom | INT | 0-2147483648–2147483647 | the bottom pixels |
| left | INT | 0-2147483648–2147483647 | the left pixels |
| right | INT | 0-2147483648–2147483647 | Parameter 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. |
| borderType | COMBO | BORDER_DEFAULT | Border type. See borderInterpolate for details. |
| valueopt | STRING | Border 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)
| Name | Type | Description |
|---|---|---|
| result | COMFY_MATCHTYPE_V3 | Echoes the 'src' input's format: an IMAGE link comes back as IMAGE, MASK as MASK, NPARRAY stays NPARRAY. |