Nodes/Difforum/Difforum · Flow Stabilize (anti-flicker)
ComfyUI Node

Difforum · Flow Stabilize (anti-flicker)

The anti-flicker fix that doesn't ghost — because it blends along motion

By chillithebillis·Created 3 months ago·Updated about a month ago· 7
Difforum · Flow Stabilize (anti-flicker)
  • frames
  • frames
strength0.50
flow_scale0.50
error_gate0.15

Feedback-loop flicker is the original sin of Deforum-style animation. Frame-to-frame, the sampler re-rolls texture and the result "boils" - the infamous shimmer that makes the whole clip look unsteady. The naive fix is frame averaging, but that ghosts: moving objects leave smeared afterimages, which is arguably worse. Difforum · Flow Stabilize (anti-flicker) is the version that knows where things are going. It computes optical flow between frames, aligns the previous frame along the flow, then blends history in - so texture gets averaged out (no more boiling) but actual motion doesn't double-expose (no ghosting). It's the temporal-coherence tool the README recommends as the fix for flicker, and the reason this matters is that the community still spends real time on it: flicker is the #1 complaint in the Deforum-style music-video corner, and people regularly post asking for workflows that kill it without wrecking motion.

Three inputs, each with a real job:

  • strength (default 0.5, 0–0.95) - how much history to blend in. The README's flicker recipe says ~0.5. Too high and even flow-aligned blending starts to smear; too low and it's a placebo.
  • flow_scale (default 0.5, 0.25–1) - how far the optical flow is trusted. Lower values damp the estimated motion, which helps on footage with noisy or extreme motion.
  • error_gate (default 0.15, 0.02–0.5) - the photometric confidence gate. When the flow estimate is unreliable (occlusions, scene cuts, big appearance changes), this threshold stops blending entirely at those pixels rather than ghosting them. This gate is the difference between this node and naive blending - it's what lets the pack claim "texture stops boiling, motion never ghosts."

Output: frames (IMAGE batch), same length in/out, designed to sit after the Feedback Sampler or Live Sampler and before Save Video - the classic final anti-flicker pass. It's the node the README names in its flicker recipe: lower per-frame strength to ~0.4–0.5, then run frames through Flow Stabilize at ~0.5.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/chillithebillis/Difforum.git difforum

Restart ComfyUI ([Difforum] loaded N nodes) or ComfyUI Manager → "Difforum". numpy-only - the optical flow here is the pack's own lightweight implementation, not a model download. (That's a feature: it's fast, and it means no extra weights to fetch.)

Common issues

  • Still flickering after stabilization - flicker has two sources: texture re-rolling and per-frame exposure/colour jumps. Flow Stabilize kills the first; the second needs the Feedback Sampler's colour matching (color_mode=lab, coherence 0.7–0.9) or a grade pass. Do both.
  • Ghosting appears anyway - usually strength too high, or error_gate too loose so unreliable flow gets blended anyway. Lower strength, raise the gate.
  • Motion looks dampened - flow_scale is swallowing real movement. Raise it toward 1.

The honest take: Flow Stabilize is a fix-it node, not a look node - you won't see it doing anything until you don't use it. But for long Deforum clips and kaleidoscope renders it's often the difference between "watchable" and "seizure warning," and it earns its place in the pipeline.

CategoryDifforum/effects

Inputs (4)

NameTypeDefaultDescription
framesIMAGE
strengthFLOAT0.500–0.95
flow_scaleFLOAT0.500.25–1
error_gateFLOAT0.150.02–0.5

Outputs (1)

NameTypeDescription
framesIMAGE