Nodes/ComfyUI-FEnodes/ChromaPin πŸ“Œ
ComfyUI Node

ChromaPin πŸ“Œ

Pin One Frame, Fix the Whole Clip

By FugitiveExpert01Β·Created 6 months agoΒ·Updated 11 days agoΒ· 6
ChromaPin πŸ“Œ
  • video
  • reference_image
  • corrected_video
  • debug_comparison
β—„reference_frame_index0β–Ί
β—„methodmklβ–Ί
β—„strength1.00β–Ί
β—„propagationuniformβ–Ί
β—„falloff_radius30β–Ί
β—„falloff_gamma1.0β–Ί

If you've run tiled diffusion or any per-frame video pass, you know the problem: the model drifts. Your tiles come back with slightly different exposure, hue, or saturation than the original, and the whole clip looks like it was graded by three different people. ChromaPin is the fix in one idea - measure the colour drift exactly once, at a single anchor frame, then remove it from every frame in the sequence.

The name is the whole trick. You supply the original reference image and tell ChromaPin which frame in your processed video corresponds to it (say frame 0 if the model changed frame 0 but the reference is the untouched original). It fits a colour-correction transform from the processed anchor frame to the reference, then applies that same transform everywhere. Because the correction is a single fitted transform rather than per-frame matching, it removes the model's drift uniformly without flattening the natural colour variation between frames - which is exactly what you want for VFX work where temporal consistency matters more than absolute accuracy.

How it works

The node offers nine colour-transfer methods, and the deps story is where you need to pay attention:

  • No extra dependencies: mkl (Monge-Kantorovich Linearization - a full 3Γ—3 cross-channel transform in Lab space, and the recommended default), reinhard_lab (per-channel mean/std in Lab), linear_rgb (per-channel gain/offset, fastest), and histogram (per-channel CDF matching, best for non-linear shifts).
  • Requires pip install kornia: reinhard_lab_gpu - same as Reinhard, but GPU-accelerated.
  • Requires pip install color-matcher: hm, mvgd, and the compound hm-mkl-hm / hm-mvgd-hm (histogram matching, then a colour transform, then histogram matching again - the README's "best overall quality" pick).

Correction propagates in two modes. uniform applies the same transform to every frame - the common case, since most model drift is consistent across a clip. falloff tapers the correction with distance from the anchor frame, which is right when the drift evolves over time or you only want to lock down a region around the reference frame.

Inputs and outputs that matter

  • video - the processed batch, shape (F, H, W, C).
  • reference_image - the untouched original you're correcting towards.
  • reference_frame_index - which frame of the video matches the reference. It's 0-based, so if your reference is the first frame, set 0. Off-by-one is the most common mistake here and it makes the correction subtly wrong rather than obviously broken.
  • method - pick from the nine above; mkl is the sensible default.
  • strength - blend between original (0.0) and fully corrected (1.0). Dial this back if the correction over-corrects.
  • propagation - uniform or falloff, with falloff_radius and falloff_gamma appearing when falloff is active (radius = frames out to zero strength; gamma = curve shape, 1.0 linear, >1 fast initial drop, <1 slow).

Outputs are corrected_video (feed it to a Save Video node) and debug_comparison, a three-panel Reference / Before / After image that's genuinely worth one glance before you batch out - it tells you in seconds whether your method and strength are sane.

Installing it

Core install is the standard pack clone, via ComfyUI Manager (search "ComfyUI-FEnodes") or:

cd ComfyUI/custom_nodes
git clone https://github.com/FugitiveExpert01/ComfyUI-FEnodes.git

Restart ComfyUI. The base methods need nothing extra. To unlock the fancier ones:

pip install kornia
pip install color-matcher

Common issues

  • The five best methods are locked until you install the optional deps. If reinhard_lab_gpu or the color-matcher methods don't show up in the dropdown, you skipped a pip install. mkl remains your best no-dependency option, and it's honestly good enough for most drift.
  • Wrong reference frame. Re-check reference_frame_index - a 0-based index pointing at the wrong frame quietly fits a transform to the wrong colours.
  • Correction looks too strong or too weak. That's what strength is for. Start at 1.0, glance at debug_comparison, and pull back to ~0.7 if the clip goes flat.
  • Falloff behaving oddly. If the correction snaps off mid-clip, falloff_radius is too small for your clip length; falloff_gamma just reshapes the curve, so adjust radius first.
CategoryFEnodes

Inputs (8)

NameTypeDefaultDescription
videoIMAGEβ€”
reference_imageIMAGEβ€”
reference_frame_indexINT00–99990-based index of the frame in the video batch that corresponds to the reference_image.
methodCOMBOmkl9 options: mkl, reinhard_lab, linear_rgb, histogram, reinhard_lab_gpu, hm-mkl-hm, +3
strengthFLOAT1.000–1Blend between original (0.0) and fully corrected (1.0).
propagationCOMBOuniformuniform = same correction every frame. falloff = correction tapers with distance from the anchor frame.
falloff_radiusoptINT301–9999[falloff mode] Frames from the reference frame at which correction strength reaches zero.
falloff_gammaoptFLOAT1.00.1–4[falloff mode] Curve shape. 1.0 = linear. >1 = fast initial drop. <1 = slow initial drop.

Outputs (2)

NameTypeDescription
corrected_videoIMAGEβ€”
debug_comparisonIMAGEβ€”