Nodes/Teskor's Utils/TS Color Match
ComfyUI Node

TS Color Match

Chunked video has visible seams between chunks. This node kills them.

By teskor-hub·Created 8 months ago·Updated 9 days ago· 4
TS Color Match
  • images
  • IMAGE
chunk_size81

If you generate long video in chunks - and with Wan Animate or AnimateDiff you basically have to - you've seen the symptom: each 81-frame chunk looks fine on its own, but stacked together every boundary has a little step in brightness, color balance, and contrast. One chunk runs warm, the next runs cool, and the whole clip reads as flickering. TS Color Match measures that drift between consecutive chunks and corrects it so the sequence plays as one continuous take instead of five slightly different ones.

It's a small node with one job, and it does it well. The README's example chain is: WanVideo Animate Embeds → Combine Frames → TS Color Match → Save Video. That's the whole point - you stitch your chunked output into one frame batch, correct the seams, then encode.

How it works

The mechanism is classic color transfer, applied chunk by chunk. The first chunk is left untouched - it's the reference your whole clip should match. For every chunk after that, the node samples the tail of the previous, already-corrected chunk and the head of the current raw chunk, compares their per-channel mean and standard deviation (sampled on a downscaled 480x270 version for speed), then remaps every frame of the current chunk so its stats land on the previous chunk's. Brightness and contrast come from the means and stds; the color cast largely sorts itself out along the way.

There's also a bonus behavior you should know about: it renders the whole corrected clip to a 30 fps .mp4 in your ComfyUI output folder as it goes. Don't be confused when a matched_sequential_transfer_<random>.mp4 shows up - the node returns the corrected frame tensor as its output, and the file is a free side copy.

The inputs that matter

Honestly, there are two, and one of them is load-bearing:

  • images (IMAGE) - your combined frames, i.e. the batch of chunks stitched in order before this node.
  • chunk_size (INT, default 81) - must match your generation chunk size. If you generate in 81-frame chunks, set 81. Get this wrong and the node will be matching stats across the wrong boundaries, which is worse than not running it at all.

Output: IMAGE - the corrected frame batch, wired straight into your video save node.

Install

It ships in the Teskor's Utils pack, so you get the four other nodes at the same time. In ComfyUI Manager, search Teskor's Utils → Install → Restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/teskor-hub/comfyui-teskors-utils
pip install -r comfyui-teskors-utils/requirements.txt

Restart and look under TS Utils. Dependencies are just numpy and opencv-python; PyTorch is deliberately not in requirements.txt because ComfyUI already ships it, and letting pip reinstall it is a reliable way to nuke a working CUDA build.

Gotchas

The chunk_size mismatch is the big one - double-check it whenever you change generation settings. And since chunk one is the reference, a first chunk that's off (too dark, wrong color grade) sets the target for everything after it. If your corrected output looks consistent but consistently wrong, fix the first chunk.

Also: the node works on the in-memory tensor, so feed it frames after combining chunks. Point it at a batch of individual chunk videos and it'll treat the whole thing as one chunk - no correction happens. The author clearly runs this exact workflow (they're active in r/comfyui building Wan Animate chunking setups), so the defaults are tuned for that 81-frame cadence.

CategoryTS Utils/Video

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
chunk_sizeINT811–99999

Outputs (1)

NameTypeDescription
IMAGEIMAGE