Nodes/comfyui_cv/CV Pinch/Stretch Map
ComfyUI Node

CV Pinch/Stretch Map

Per-axis pinch or stretch anchored at the frame borders (the edges never move): coordinates are remapped by s' = 1 - (1 - |s|)^power on each side of the center. power > 1 compresses the image content toward the center (pinch), power < 1 spreads it toward the edges (stretch), 1 = no change. The two axes are independent - e.g. squeeze only x. An off-center pivot makes the effect asymmetric.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Pinch/Stretch Map
  • map_x
  • map_y
  • map_x
  • map_y
power_x1.50
power_y1.50
center_x0.50
center_y0.50
Categoryimage/CV/remap

Inputs (6)

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).
power_xFLOAT1.500.05–20> 1 pinch, < 1 stretch, 1 = identity.
power_yFLOAT1.500.05–20> 1 pinch, < 1 stretch, 1 = identity.
center_xoptFLOAT0.500–1Pivot as a fraction of the width.
center_yoptFLOAT0.500–1Pivot as a fraction of the height.

Outputs (2)

NameTypeDescription
map_xNPARRAY
map_yNPARRAY