ComfyUI Node
cv2.remap
Raw wrapper of cv2.remap(src, map1, map2, interpolation, borderMode?, borderValue?, hint?). Parameters marked '?' are optional; blank means OpenCV default. See the OpenCV documentation for details.
cv2.remap
- src
- map1
- map2
- result
◄interpolationINTER_LINEAR►
◄borderModeBORDER_DEFAULT►
◄borderValue►
◄hintALGO_HINT_DEFAULT►
Categoryimage/CV/low-level/cv2 R
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. | |
| map1 | NPARRAY | The first map of either (x,y) points or just x values having the type CV_16SC2 , CV_32FC1, or CV_32FC2. See #convertMaps for details on converting a floating point representation to fixed-point. A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here. | |
| map2 | NPARRAY | The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map if map1 is (x,y) points), respectively. A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here. | |
| interpolation | STRING | INTER_LINEAR | Interpolation method (see #InterpolationFlags). The methods #INTER_AREA #INTER_LINEAR_EXACT and #INTER_NEAREST_EXACT are not supported by this function. The extra flag WARP_RELATIVE_MAP can be ORed to the interpolation method (e.g. INTER_LINEAR | WARP_RELATIVE_MAP) cv2.remap flags: one of INTER_LINEAR, INTER_NEAREST, INTER_CUBIC, INTER_LANCZOS4 plus any of WARP_RELATIVE_MAP, WARP_FILL_OUTLIERS, WARP_INVERSE_MAP, pipe-joined (e.g. "INTER_LINEAR | WARP_RELATIVE_MAP"). In the UI this renders as a dropdown with one toggle per flag. |
| borderModeopt | COMBO | BORDER_DEFAULT | Pixel extrapolation method (see #BorderTypes). When borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image that corresponds to the "outliers" in the source image are not modified by the function. |
| borderValueopt | STRING | Value used in case of a constant border. By default, it is 0. 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. | |
| hintopt | COMBO | ALGO_HINT_DEFAULT | Implementation modification flags. Set #ALGO_HINT_APPROX to use FP16 precision (if available) for linear calculation for faster speed. See #AlgorithmHint. |
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. |