Nodes/ComfyUI-CustomNodeKit/Auto Color Drift Correction V4.3 (两遍校正)
ComfyUI Node

Auto Color Drift Correction V4.3 (两遍校正)

The node that stops your long-video seams from flashing color

By user2318·Created 4 months ago·Updated about a month ago· 56
Auto Color Drift Correction V4.3 (两遍校正)
  • images
  • prev_frames
  • corrected_images
  • drift_info
modestandard
overlap_count5
seam_strength0.00
max_offset0.020
residual_strength0.20

If you've ever generated a Wan or SCAIL-2 video in segments - and for anything longer than 81 frames, you have to - you know the tell. The first five frames of every new chunk are a slightly different color temperature than the tail of the previous one. It's not noise, it's drift: each sampling pass lands on marginally different color values, and when you stitch the segments together the seams flash. Auto Color Drift Correction exists to kill exactly that.

It's the V4.3 "two-pass" version of the author's color stabilizer, and it's one of the more thoughtful nodes in this pack because it stops pretending drift is a simple offset. The name is descriptive: it detects a drift, corrects the whole new segment globally, then goes back and micro-adjusts the residual per frame. No API, no model download, nothing to fetch - it's pure tensor math on the frames you feed it.

How it works

Feed it the current segment's frames as images and it treats the first overlap_count frames (default 5) as the overlap with the previous segment, leaving them untouched. Everything after that gets corrected in passes:

  • Pass 0 (prev_frames alignment): if you wire in the previous segment's tail via prev_frames, the whole segment is shifted to match it. This is the precise seam alignment you want in a real multi-segment loop.
  • Pass 1 (global offset): it averages the last few overlap frames against the first few new frames, computes the jump vector, and applies one clamped offset to all new frames. Per-channel clamping to max_offset (default 0.02, roughly 5.1 pixel values) keeps it from overcorrecting.
  • Pass 2 (residual fine-tune): each new frame is pulled toward the reference independently, clamped to max_offset × residual_strength. Because each frame is computed on its own, errors don't accumulate down the segment the way an EMA chain would.

In auto mode the node decides for you: if the multi-frame jump is below a threshold (0.0005), it decides there's no real drift and just passes through. That's the mode to start in - it's genuinely the "set it and forget it" option.

The inputs you'll actually set

  • mode - standard (you tune), auto (it decides), off (pure bypass). Start with auto.
  • overlap_count - must match how many frames of your previous segment you actually kept as overlap.
  • prev_frames - the previous segment's tail. Wiring this is the difference between "good" and "seamless".
  • seam_strength, max_offset, residual_strength - the dials. If you see banding, lower residual_strength; if the seam is still obvious, raise seam_strength.

Outputs are corrected_images (the fixed batch, ready to feed your save/encode node) and drift_info, a string that logs every offset it applied in readable form plus a JSON block. Keep an eye on it once - if the numbers stay tiny, the node is mostly along for the ride, which is exactly what you want.

Installing it

This ships in user2318/ComfyUI-CustomNodeKit, a Chinese-authored toolkit built around WanAnimate and SCAIL-2 long-video workflows. Easiest install is ComfyUI Manager: search "CustomNodeKit" and hit install. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/user2318/ComfyUI-CustomNodeKit.git
cd ComfyUI-CustomNodeKit
pip install -r requirements.txt

then restart ComfyUI. The requirements.txt pulls in tqdm, opencv-python, mediapipe and imageio-ffmpeg, and the pack's install.py auto-installs groundingdino-py and transformers on startup for the object-detection nodes. This node itself is pure torch - zero extra weight.

The gotcha

It only helps if you actually put it in the loop. The drift you're fixing happens between segments, so this needs to sit inside your segment loop (after VAE decode, before the next segment's context window reads the tail) with prev_frames connected. Sticking it on a single already-generated video does nothing useful, and the README's own workflow files treat it as part of the segment pipeline rather than a post-process. Wire it like that and the flashing seams just stop.

CategoryCustomNodes/Video

Inputs (7)

NameTypeDefaultDescription
imagesIMAGE当前段生成的全部帧序列 (B, H, W, C)。
modeCOMBOstandardstandard=手动参数控制; auto=自动检测漂移后决策; off=完全旁路
overlap_countINT51–20重叠帧数量。前 overlap_count 帧保持不动。
prev_framesoptIMAGE(可选)上一段尾部重叠帧。接入后做精确段间对齐。
seam_strengthoptFLOAT0.000–1第一遍全局偏移强度。0=禁用第一遍。auto模式下自动决策。
max_offsetoptFLOAT0.0200.001–0.05第一遍最大单通道偏移钳制值。0.02≈5.1像素值。
residual_strengthoptFLOAT0.200–1第二遍残余微调强度(相对max_offset的比例)。0=禁用第二遍。

Outputs (2)

NameTypeDescription
corrected_imagesIMAGE
drift_infoSTRING