Nodes/ComfyTV/UV Remap
ComfyUI Node

UV Remap

Warp Video Any Way You Like With a Map

By jtydhr88·Created 3 months ago·Updated about 16 hours ago· 725
UV Remap
  • video
  • uv_video
  • uv_image
  • video
force_run_token0
project_id
parent_output_id0
modestmap
wrapclamp
flip_vtrue
amount32
u_offset0.00
v_offset0.00
u_scale1.00
v_scale1.00

UV remapping is the general-purpose warp: you give the node a UV/ST map - an image that says "for this output pixel, sample from that input pixel" - and it reshapes your video accordingly. That one mechanism covers lens distortion, anamorphic squeeze, panorama unwrapping, and any custom warp you can draw, which is why it's one of the most broadly useful stages in the ComfyTV video suite, under ComfyTV/VideoFX.

It's the apply-half of the STMap pair: STMap Generate bakes lens math into a map; UV Remap applies any map to footage. The node needs two things wired: the video to warp and a UV source - either uv_video or uv_image (it'll take either; the code checks uv_video first, then uv_image, and errors if neither is connected: "UV Remap needs a UV source - wire a uv_video or uv_image input."). One video comes out.

Then the controls that bend the mapping without drawing a new map:

  • mode - stmap (default) or idistort. STMap treats the map as a straight sample-coordinate lookup; idistort inverts the mapping direction, which is the setting you want when your map was authored the other way around.
  • wrap - clamp (default), repeat, or mirror. What happens at the edges when the map points outside the frame. Clamp smears the edge pixels; repeat/mirror tile them - the difference between "soft border" and "seamless loop."
  • flip_v (default on) - flips the map's V axis. Almost every STMap tool fights this at some point because image coordinates and texture coordinates disagree on which way is up; this is the built-in fix.
  • amount (0–512, default 32) - the map's overall strength multiplier. Dial this to ease a strong warp in or out without regenerating anything.
  • u_offset/v_offset (-1 to 1) - shift the whole mapping, i.e. pan the warp.
  • u_scale/v_scale (-4 to 4) - stretch the mapping along each axis (negative flips it).

The workflow shape

Generate → apply: STMap Generate gives you the lens map, UV Remap applies it to the clip, and because the map is resolution-matched and deterministic, every frame gets the identical warp. The map can also come from anywhere - a noise image for a wobble effect, an equirectangular projection for 360° work, a hand-drawn gradient. That's the power: any image is a potential warp, and this node is the interpreter.

Install

With ComfyTV:

cd ComfyUI/custom_nodes
git clone https://github.com/jtydhr88/ComfyTV

Restart ComfyUI; under ComfyTV → VideoFX. ComfyUI Manager: search "ComfyTV". Desktop/macOS: clone into the running instance's absolute custom_nodes (startup-log path), fix any ComfyTV/ComfyTV/ nesting, full backend restart. No models, no extra Python deps.

Troubleshooting

  • "UV Remap needs a UV source." You forgot both uv_video and uv_image. Wire one.
  • The warp is upside down or mirrored. That's the flip_v default biting - toggle it off.
  • Edges smear into streaks. wrap on clamp with a map that goes out of bounds. Switch to repeat/mirror, or lower amount.
  • Warp is way too strong/weak. amount is the master strength - no need to regenerate the map to tune it.
CategoryComfyTV/VideoFX

Inputs (14)

NameTypeDefaultDescription
force_run_tokenINT00–2147483647Internal — bumped on Run to invalidate ComfyUI's input cache.
project_idSTRINGInternal — populated by the projectStore on the frontend.
parent_output_idINT00–2147483647Internal — lineage parent set by spawn handlers on the frontend.
modeCOMBOstmap2 options: stmap, idistort
wrapCOMBOclamp3 options: clamp, repeat, mirror
flip_vBOOLEANtrue
amountFLOAT320–512
u_offsetFLOAT0.00-1–1
v_offsetFLOAT0.00-1–1
u_scaleFLOAT1.00-4–4
v_scaleFLOAT1.00-4–4
videooptCOMFYTV_VIDEO
uv_videooptCOMFYTV_VIDEO
uv_imageoptCOMFYTV_IMAGE

Outputs (1)

NameTypeDescription
videoCOMFYTV_VIDEO