Nodes/ComfyUI-TKVideoZoom/Video Speed Adjuster
ComfyUI Node

Video Speed Adjuster

Speed-ramp a clip in four zones — no optical flow required

By trashkollector·Created about a year ago·Updated about a year ago· 0
Video Speed Adjuster
  • image
  • image
  • new_fps
  • new_frame_count
◄frame_count81►
◄fps16►
◄new_fps▾►
◄speed_zone1▾►
◄speed_zone2▾►
◄speed_zone3▾►
◄speed_zone4▾►

The speed ramp - clip starts slow, holds, then blasts - is one of those moves every action video has and most people leave ComfyUI to do. This node brings it in-graph: it re-times a clip so different quarters of it run at different speeds, then hands you the new frame count and fps to encode with. Third of the five nodes in the TKVideoZoom pack, and like the rest it's deterministic frame math - no model, no downloads.

How it works

Your clip is split into four equal sections - the first 25% of frames, the next 25%, and so on - and each section has its own speed_zone knob (very slow / slow / normal / fast / very fast). For every frame, the node works out how many frames to insert or drop for that zone based on a target playback rate, and re-times accordingly:

  • Slow zones insert frames between consecutive frames by linear interpolation - blending the two neighbors. More inserts = slower playback.
  • Fast zones drop frames (keep every nth), which is what gives a fast zone its choppy, time-lapse feel.
  • normal reproduces the source timing.

new_fps (30 or 60) is the target playback speed - the rate you'll encode the result at. The output includes new_fps and new_frame_count precisely so you can tell the encoder how long the re-timed clip actually is.

Inputs and outputs

Required: image, frame_count (default 81 - set this to your real frame count), fps (source fps, default 16), new_fps (30 or 60), and speed_zone1–speed_zone4. Outputs: image, new_fps (FLOAT), new_frame_count (INT).

The wiring pattern is the pack standard - VHS_LoadVideo in front, VHS_VideoCombine behind:

VHS_LoadVideo ──image──> TKVideoSpeedZones ──image──────> VHS_VideoCombine
                       (frame_count, fps)  ──new_fps────>         frame_rate
                                          ──new_frame_count─>   (loop_count / info)

The demo workflow feeds new_fps straight into VHS_VideoCombine's frame rate, which is exactly right - if you encode at the old fps, the slow parts come out at the wrong speed.

Where people get burned

Three things, all real:

  • It's linear blending, not motion interpolation. Slow zones smudge frames together, and fast-moving content will ghost during a slow-mo section. There's no optical flow, no motion estimation - genuinely interpolated slow-mo is RIFE/film-interpolation territory, not this node. Fine for static or slow subjects; a trap if you're slow-moing a sprint.
  • frame_count truncates. The loop breaks when i passes frame_count - 1, so an under-set frame_count silently cuts the tail of your clip. Wire it from VHS_LoadVideo's frame_count output instead of trusting the 81 default.
  • There's no audio. Check the schema - no audio input, no audio output. Re-timing changes the video length and there's nothing here to carry or re-sync the soundtrack. Plan to handle audio separately after the fact; it's the pack's audio-less node and it's easy to not notice until you export silence.

The zone boundaries are also fixed at the quarter points - you can't drag them around. Want the slow part to be 10% or 60% of the clip? Not with this node; you'd split the clip first and run two of these. For a fixed four-way ramp it does exactly what it says, though, and it's instant.

Install

ComfyUI Manager → search "TKVideoZoom" → install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/trashkollector/TKVideoZoom

Restart. No models, no keys; the only real dependency is OpenCV, which you already have if VHS_LoadVideo works. Ignore the pack's requirements.txt torch pins - stock ComfyUI plus cv2 covers it.

CategoryTKVideoZoom

Inputs (8)

NameTypeDefaultDescription
imageIMAGE—
frame_countINT81—
fpsFLOAT16—
new_fpsCOMBO2 options: 30, 60
speed_zone1COMBO5 options: very slow, slow, normal, fast, very fast
speed_zone2COMBO5 options: very slow, slow, normal, fast, very fast
speed_zone3COMBO5 options: very slow, slow, normal, fast, very fast
speed_zone4COMBO5 options: very slow, slow, normal, fast, very fast

Outputs (3)

NameTypeDescription
imageIMAGE—
new_fpsFLOAT—
new_frame_countINT—