Nodes/ComfyUI-MAINodes/H3 Delta Color Carry (alpha)
ComfyUI Node

H3 Delta Color Carry (alpha)

Stop the chain of clips from slowly getting darker

By matlowai·Created 17 days ago·Updated about 16 hours ago· 112
H3 Delta Color Carry (alpha)
  • samples
  • vae
  • samples
  • report
anchor_stats
current_stats
prefix_frames39
strength0.50
max_luma_shift6.00
max_saturation_change0.06
spatial_kernel3

When you extend a clip into a chain of segments, every carried handle is a VAE round trip - encode, decode, encode again - and each round trip darkens the picture by about 2.4%. Chains accumulate it. Link two segments and you can see it; link four and the tail is visibly off. H3 Delta Color Carry is the fix that attacks the cause instead of slapping a grade on the output: it cancels the VAE's encode bias so that only the intended color correction survives the carry.

This one is adapted, with permission, from ComfyUI-MiniMaxH3-Contex-Loop's Color-Stable Drift AV (GPL-3.0, same license as this pack) - the per-module credit lines in h3_color_carry.py say exactly what was taken and what deliberately wasn't.

How it works - the clever bit

Instead of regrading the sampled latent (which would itself be a guess about what the VAE wants), the node decodes the carried prefix once, applies a weak exposure/saturation correction in RGB, and then encodes both the original and the corrected frames. It adds only E(corrected) − E(original) to the latent's prefix region. The encode bias appears in both terms and cancels - only the intended grade survives. The delta is spatially low-passed (a spatial_kernel, default 3) and tapered from zero at the old edge to full strength beside the generated future. Audio is never touched.

That's the whole philosophy: never let the correction itself become another source of drift.

The inputs

  • samples - the target video latent (your extend graph's VAEEncode output).
  • vae - your H3 VAE.
  • anchor_stats / current_stats - JSON strings from the companion H3 Scene Color Stats node: scene one's delivered tail for the anchor, the current predecessor's tail for the current. If they're identical (the first link of a chain), the transform is the identity and the latent passes through untouched - an early exit, no work done.
  • prefix_frames (39) - the carried handle, on the 17k+5 grid.
  • strength (0.50), max_luma_shift (6, in 8-bit code values), max_saturation_change (0.06) - the clamps that keep the correction sub-visible on mildly-drifted content.

Outputs: samples (patched latent) and report (what brightness/saturation delta it applied, if any).

Wire it between the extend graph's VAEEncode and H3 V2V Init - it runs on the video latent before the audio gets packed, so if you wire it after V2V Init it'll refuse with a clear error.

Honest status

The README states it plainly: the active path has been exercised on a real 4-link render (fires, corrects in the anchor direction, stays under its clamps on mildly-drifted content), but a strong-drift bench - the case where the 2.4%-per-round-trip signature actually accrues - is still owed. So: this is alpha-grade chain hygiene, not a solved problem. If your chain is two links and looks fine, don't add complexity. If you're chaining four-plus and watching the color crawl, this is the node built for exactly that, and it's the right tool for the job so far as anyone has measured.

Installing it

Pure Python, no pip deps:

cd ComfyUI/custom_nodes
git clone https://github.com/matlowai/ComfyUI-MAINodes

Restart, look under MAINodes/alpha. Example graphs want ComfyUI-KJNodes; the nodes don't. H3 underneath is community-licensed (US, EU, UK, South Korea excluded). And if you're on a chain that needs this, bring its sibling H3 Drift Control too - drift and color are the two things that decay down a chain, and this pack splits them for a reason.

CategoryMAINodes/alpha

Inputs (9)

NameTypeDefaultDescription
samplesLATENTthe target video latent (extend graph's VAEEncode output)
vaeVAE
anchor_statsSTRINGH3 Scene Color Stats of scene ONE's delivered tail
current_statsSTRINGH3 Scene Color Stats of the CURRENT predecessor's tail
prefix_framesoptINT3922–3600carried handle in pixel frames on the 17k+5 grid
strengthoptFLOAT0.500–1
max_luma_shiftoptFLOAT6.000–32clamp, in 8-bit code values
max_saturation_changeoptFLOAT0.060–0.5
spatial_kerneloptINT31–15odd; low-pass on the latent delta

Outputs (2)

NameTypeDescription
samplesLATENT
reportSTRING