Nodes/FM_nodes/StabStitch Stabilize
ComfyUI Node

StabStitch Stabilize

Free video stabilization from a stitching model

By FuouM·Created 2 years ago·Updated about a year ago· 9
StabStitch Stabilize
  • video_1
  • combined
  • stab
  • mask
interpolate_modeFAST
do_linear_blendfalse

The StabStitch models were built to stitch two overlapping videos, but the "keep the combined output from shaking" half of that pipeline is, on its own, a stabilizer. StabStitch Stabilize is that half, exposed as a node: feed it one shaky video, get a stabilized one back, no second video required. It's a pleasant surprise - most research-stitching code doesn't bother splitting out the stabilization pass - and if you've got handheld footage in ComfyUI anyway, it's cheaper than round-tripping through an external stabilizer.

How it works

It runs the same three learned networks as the full StabStitch node - the spatial warp that aligns frames, the temporal warp that smooths motion between frames, and the smooth warp that produces a stable target mesh - but with a single input. The model estimates the frame-to-frame warping, smooths the resulting motion path, and re-renders the video onto the stable mesh. Same 360x480 internal resolution as its parent, and the same per-frame pipeline.

The inputs that matter

  • video_1 - the shaky clip, as an IMAGE batch.
  • interpolate_mode - FAST (default) or NORMAL. Same trade as the stitch node: FAST uses grid_sample and can leave thin black edges where frames are warped; NORMAL is slower but avoids the black boundary. The bundled workflow runs FAST with do_linear_blend on.
  • do_linear_blend - boolean, default off. Turn it on to blend the warped frame with the reference and help kill dark borders.

Three outputs, mirroring the stitch node: combined (the stabilized video), stab (the warped frame sequence), and mask (the warping mask as an IMAGE).

Installing it

FM_nodes via ComfyUI Manager (search FM_nodes) or:

cd ComfyUI/custom_nodes
git clone https://github.com/FuouM/FM_nodes

then restart. Requirements: just torch and einops. The three model files - temporal_warp.pth, spatial_warp.pth, smooth_warp.pth - come from the StabStitch pre-trained models and go in custom_nodes/FM_nodes/models/stabstitch/. All three must be present or the node errors.

Where people get burned

Set expectations before you queue a two-minute clip. First, the resolution: everything is processed at 360x480 internally, so run the StabStitch Crop Resize node first to control the crop, and plan to upscale after if you need full res. Second, it's slow - three networks per frame, frame by frame, with no chunking shortcut. And third, this is research-grade stabilization: it smooths visible shakiness well, but it's not Gyroflow - don't expect it to rescue violent handheld motion or rolling-shutter chaos. For moderate shake on footage that's already in your ComfyUI graph, though, it's a genuinely useful freebie you wouldn't expect to find in a stitching pack.

CategoryFM_nodes/StabStitch

Inputs (3)

NameTypeDefaultDescription
video_1IMAGE
interpolate_modeCOMBOFAST2 options: FAST, NORMAL
do_linear_blendBOOLEANfalse

Outputs (3)

NameTypeDescription
combinedIMAGE
stabIMAGE
maskIMAGE