Nodes/comfyui_cv/CV Vector Displacement Map
ComfyUI Node

CV Vector Displacement Map

Adds a per-pixel 2-D (dx, dy) displacement from a multi-channel source to the coordinate maps - the key difference from the scalar 'DisplacementMap' (which drives both axes from the same grayscale). Connect a normal map (R=dx, G=dy), Sobel gradients, optical flow, or any multi-channel image to 'vector_field'; or wire individual dx/dy arrays directly. uint8 inputs are mapped to [-1, 1] so mid-gray = no displacement; float inputs are used as raw pixel-offset values. Designed for use with WARP_RELATIVE_MAP.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Vector Displacement Map
  • map_x
  • map_y
  • vector_field
  • dx
  • dy
  • map_x
  • map_y
strength_x10.0
strength_y10.0
Categoryimage/CV/remap

Inputs (7)

NameTypeDefaultDescription
map_xNPARRAYIncoming source-x coordinate map. Start the chain with 'CV Identity Map' or 'CV Relative Identity Map'.
map_yNPARRAYIncoming source-y coordinate map (same shape as map_x).
strength_xFLOAT10.0-10000–10000Multiplier for the X displacement in pixels.
strength_yFLOAT10.0-10000–10000Multiplier for the Y displacement in pixels.
vector_fieldoptNPARRAY,IMAGE,MASKMulti-channel displacement source: uses ch0 as dx, ch1 as dy. HxWx2 (direct vector field), HxWx3/4 (normal map: R->dx, G->dy), or HxW (same for both axes). uint8 mapped to [-1,1]; float used as-is. 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.
dxoptNPARRAYPer-pixel X displacement (overrides vector_field when connected). Single-channel HxW.
dyoptNPARRAYPer-pixel Y displacement (overrides vector_field when connected). Single-channel HxW.

Outputs (2)

NameTypeDescription
map_xNPARRAYDisplaced source-x coordinate map.
map_yNPARRAYDisplaced source-y coordinate map.