Nodes/ComfyUI-SA-Nodes-QQ/Video Stretch Start End (QQ)
ComfyUI Node

Video Stretch Start End (QQ)

Slow the First or Last Frames Without Re-Rendering

By siraxe·Created 12 months ago·Updated 6 days ago· 74
Video Stretch Start End (QQ)
  • images
  • audio
  • images
  • audio
◄apply_to_endfalse►
◄frames5►
◄factor2.0►
◄gradual_easefalse►
◄use_rifefalse►
◄ckpt_name▾►

The problem it solves

Video models are bad at starting slow. Ask Wan 2.2 for a clip and whatever happens in frame one happens at full speed - you can't prompt "ease into the motion," and a longer generation doesn't change the pacing of the first second either. What you want is an editorial speed ramp at the head or tail of the shot.

This node does it inside ComfyUI, on the decoded frames, after generation. It takes a batch of IMAGE frames and stretches the first N (or last N) along the time axis - no sampler, no re-render, no model. Pure frame arithmetic on output you already paid for. Five frames at factor 2 come back as ten, so the opening plays at half speed.

Uniform stretch vs gradual ease

Default mode is frame duplication. Each frame is repeated so the region plays factor times slower - at factor: 2 the index pattern over five frames is 0,0,1,1,2,2,3,3,4,4. Cheap, instant, and the seam is handled: the code force-keeps the segment's last frame so the handoff to the untouched part never skips one.

The catch is that duplicated frames look duplicated. At factor 2 over a handful of frames, that reads as a deliberate ramp; push it to factor 5 and you've made a slideshow.

gradual_ease: true is the interesting mode, and it only does anything when factor > 1. Rather than a uniform slowdown, playback speed starts at 1/factor at the selected edge and eases back to normal via a smoothstep curve, so the clip accelerates out of slow motion instead of snapping to full speed. Frames stay dense at the edge and get progressively dropped toward the boundary, which makes the region shorter than a flat stretch: at factor: 2, 10 frames become 13 instead of 20. Audio, if you supplied any, is remapped along the same curve and stays in sync.

The inputs that actually matter

  • images - your decoded frames. Wire it straight off a loader or a sampler's VAE Decode.
  • apply_to_end - false stretches the start, true stretches the end. That's the direction switch.
  • frames - how many frames the ramp covers (default 5). Ramp length in frames, not seconds; at Wan's 16 fps, 5 frames is under a third of a second.
  • factor - the slowdown multiplier (default 2.0). This is the strength dial.
  • gradual_ease and use_rife - the two quality switches, both off by default.

audio is the only optional input, and outputs are images plus audio - both, always - so the natural chain runs into core's Create Video (images + audio + fps) and then Save Video, or VHS's Video Combine. If there's nothing to stretch, the node passes everything through untouched.

RIFE mode

use_rife: true swaps duplication for real interpolation: the region goes through RIFE at a multiplier of ceil(factor) (minimum 2), then gets resampled down to the exact target frame count. That's what makes a factor-2 ramp look like slow motion rather than stutter. It also costs the only dependency this node has - the ckpt_name dropdown is populated from ComfyUI's models/frame_interpolation folder, the same one core's frame interpolation nodes use. Drop something like rife47.pth or rife49.pth in there (ComfyUI Manager's model installer can fetch them) and reload.

Two details from the source: legacy 4.6–4.9 checkpoints run through an embedded 4-block architecture while newer ComfyUI-format IFNet checkpoints go through comfy_extras, and an unrecognized file raises rather than quietly doing something wrong. RIFE is 3-channel, so any alpha gets trimmed here.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/siraxe/ComfyUI-SA-Nodes-QQ
# restart ComfyUI

Or search ComfyUI-SA-Nodes-QQ in ComfyUI Manager - the pack is on the Comfy registry under publisher siraxe. requirements.txt in the repo is empty, so there's no pip step for this node; RIFE aside, there's nothing to download.

Heads up on the README: its install block still prints the old clone URL (ComfyUI-WanVideoWrapper_QQ). The repo was renamed at v1.3.4 because ComfyUI printed an import warning against kijai's WanVideoWrapper naming. Delete any leftover wanwrapper_qq folder from custom_nodes, and don't let an old workflow JSON drag it back. You want one pack, not two.

Where people get burned

An empty ckpt_name dropdown. If models/frame_interpolation is empty, that field has nothing to list. Harmless while you're duplicating frames - flip use_rife on and you get an error. It's a required input that only matters in one mode.

RIFE on an older ComfyUI. The node imports core's interpolation module at load time; on a build that predates it, use_rife throws instead of degrading. Update ComfyUI first.

Feeding the result back through a VAE. Wan's VAE compresses time roughly 4x, so valid frame counts are 4n+1 and a re-encode can hand back a frame or two fewer than you sent. Stretching output for a final export is fine; stretching mid-pipeline and re-encoding is where the arithmetic bites.

The rest of the pack is a Wan toolkit from u/sir_axe - spline editors, a LoRA loader, MatAnyone2 masking - and some of those do pull in extra deps. This one doesn't. It's the single-purpose utility of the set.

CategoryWanVideoWrapper_QQ/video

Inputs (8)

NameTypeDefaultDescription
imagesIMAGE—
apply_to_endBOOLEANfalse—
framesINT50–10000—
factorFLOAT2.00.1–20—
gradual_easeBOOLEANfalse—
use_rifeBOOLEANfalse—
ckpt_nameCOMBO1 options:
audiooptAUDIO—

Outputs (2)

NameTypeDescription
imagesIMAGE—
audioAUDIO—