Nodes/comfyui_cv/CV Displacement Map
ComfyUI Node

CV Displacement Map

Shifts each coordinate by the brightness of a displacement image: offset = (gray - 0.5) * 2 * strength, so mid-gray moves nothing, white pulls from +strength pixels away and black from -strength. Feed a blurred mask, noise, a depth map or the image's own luminance (glass/heat-haze refraction). The displacement image is converted to grayscale and resized to the map size automatically.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Displacement Map
  • map_x
  • map_y
  • displacement
  • map_x
  • map_y
strength_x16.0
strength_y16.0
Categoryimage/CV/remap

Inputs (5)

NameTypeDefaultDescription
map_xNPARRAYIncoming source-x coordinate map to distort. Start the chain with 'CV Identity Map'; further remap nodes compose onto it.
map_yNPARRAYIncoming source-y coordinate map (must share map_x's shape - both come from the same chain).
displacementNPARRAY,IMAGE,MASKGray or color image; uint8/uint16 are scaled to 0-1, float is 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.
strength_xFLOAT16.0-10000–10000Maximum horizontal shift in pixels (negative inverts the direction).
strength_yFLOAT16.0-10000–10000Maximum vertical shift in pixels (negative inverts the direction).

Outputs (2)

NameTypeDescription
map_xNPARRAY
map_yNPARRAY