ChromaPin π
Pin One Frame, Fix the Whole Clip
- video
- reference_image
- corrected_video
- debug_comparison
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), andhistogram(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 compoundhm-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;mklis the sensible default.strength- blend between original (0.0) and fully corrected (1.0). Dial this back if the correction over-corrects.propagation-uniformorfalloff, withfalloff_radiusandfalloff_gammaappearing 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_gpuor thecolor-matchermethods don't show up in the dropdown, you skipped a pip install.mklremains 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
strengthis for. Start at 1.0, glance atdebug_comparison, and pull back to ~0.7 if the clip goes flat. - Falloff behaving oddly. If the correction snaps off mid-clip,
falloff_radiusis too small for your clip length;falloff_gammajust reshapes the curve, so adjust radius first.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| video | IMAGE | β | |
| reference_image | IMAGE | β | |
| reference_frame_index | INT | 00β9999 | 0-based index of the frame in the video batch that corresponds to the reference_image. |
| method | COMBO | mkl | 9 options: mkl, reinhard_lab, linear_rgb, histogram, reinhard_lab_gpu, hm-mkl-hm, +3 |
| strength | FLOAT | 1.000β1 | Blend between original (0.0) and fully corrected (1.0). |
| propagation | COMBO | uniform | uniform = same correction every frame. falloff = correction tapers with distance from the anchor frame. |
| falloff_radiusopt | INT | 301β9999 | [falloff mode] Frames from the reference frame at which correction strength reaches zero. |
| falloff_gammaopt | FLOAT | 1.00.1β4 | [falloff mode] Curve shape. 1.0 = linear. >1 = fast initial drop. <1 = slow initial drop. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| corrected_video | IMAGE | β |
| debug_comparison | IMAGE | β |