Nodes/ComfyUI-Info-Prompt-Toolkit/Local Temporal Deflicker
ComfyUI Node

Local Temporal Deflicker

Kill the brightness breathing when you detail video frames one by one

By kinorax·Created 4 months ago·Updated 25 days ago· 2
Local Temporal Deflicker
  • original_images
  • processed_images
  • masks
  • images
strength0.70

Here's a failure mode every video-in-ComfyUI person has met: you run each frame through a detailer or a color-match pass to sharpen it, and the result flickers. Not motion flicker - a slow brightness "breathing," especially in faces and skin, because every frame's post-process landed on a slightly different exposure. It's the classic per-frame-processing artifact, and there are almost no dedicated fixes for it. IPT-LocalTemporalDeflicker is one. It stabilizes low-frequency luminance inside a mask across an image list, and it's the most specialized node in the Info-Prompt-Toolkit pack - and the one that has essentially no mainstream equivalent.

How it works

You feed it three synchronized lists: original_images (the untouched frames, used only to estimate motion), processed_images (the flickering detailer/color-match output you want fixed), and masks (a per-frame soft mask limiting where analysis and correction happen). The node crops to the mask region, downsamples to a small working size, and builds a 4-level optical-flow pyramid from the original frames' grayscale to track motion. It then looks at each frame's log-luminance, warps its neighbors onto it using the flow, and estimates the slow, low-frequency luminance drift - that's the breathing. A correction is computed and blended back through the mask at your chosen strength (0–1, default 0.7), capped so it can't overcorrect. It's deliberately conservative: low-frequency drift only, per-pixel noise untouched, and motion handled by the flow rather than blurring everything together.

That "original frames used only to estimate motion" bit is the design trick: because it keys motion off the clean originals, it doesn't get fooled by the very artifacts it's removing.

The inputs that matter

  • original_images - clean source frames, for motion estimation only.
  • processed_images - the frames to stabilize.
  • masks - per-frame soft mask; correction happens inside it.
  • strength - 0 leaves frames alone, 1 applies full correction. Default 0.7 is a sane start.

One output: images, the stabilized list, same length as the input.

Installing it

Part of the IPT pack:

cd ComfyUI/custom_nodes
git clone https://github.com/kinorax/comfyui-info-prompt-toolkit.git
cd comfyui-info-prompt-toolkit
pip install -r requirements.txt

Restart ComfyUI, or install via ComfyUI Manager ("ComfyUI-Info-Prompt-Toolkit"). It runs on torch alone - no model files, no extra heavy deps.

Where people get burned

The lists must be the same length and the same resolution - a frame-count mismatch throws immediately, which is the correct behavior but means you need to keep the original frames around through the whole detailer chain. If you feed the processed frames as original_images too, motion estimation gets contaminated by the flicker and the fix weakens; keep the true originals. And set expectations: this kills slow luminance drift, capped at about a fifth of a stop per correction - it won't rescue violent per-frame exposure jumps or actual object flicker. If frames are wildly different, fix the upstream pass first, then use this to smooth what remains. It's a niche node, but for its one job - stable skin tones across a frame-by-frame detail pass - it's the right tool.

CategoryInfo-Prompt-Toolkit/Mask

Inputs (4)

NameTypeDefaultDescription
original_imagesIMAGEOriginal frame list used only for optical-flow motion estimation.
processed_imagesIMAGEDetailer and Color Match output frame list to stabilize.
masksMASKPer-frame soft mask list that limits analysis and correction.
strengthFLOAT0.700–1Amount of detected temporal luminance variation to correct.

Outputs (1)

NameTypeDescription
imagesIMAGE