Color Match 2Refs Blend AutoWeights
Auto-Ramping a Two-Reference Match Across Frames
- image_ref_a
- image_ref_b
- image_target
- image
The video problem
The hardest thing about stitching AI video clips together isn't the cut - it's the color. Generate a scene bridge with VACE or an image-to-video pass and the middle clip will often land with a slightly different temperature than either neighbor, so the transition feels like a jump instead of a dissolve. Manually grading every intermediate frame is misery. Color Match 2Refs Blend AutoWeights exists so you don't have to.
It's the sibling of this pack's ColorMatch2Refs, with one crucial difference: instead of a manual blend weight, weight_a is computed for you, frame by frame, ramping across the batch. First frame leans toward reference A, last frame toward reference B, everything between is a graded crossfade.
The three-clip setup
The README's scenario is the one you'll actually use it for. You have a sequence of clips A → B → C and want clip B to smoothly inherit the color of A at its start and C at its end:
- Feed the last frame of Clip A as
image_ref_a - Feed the first frame of Clip C as
image_ref_b - Feed all frames of Clip B as
image_target
Out the other end: every frame of B is matched to both references, then blended with a weight that walks from 1.0 (all A) at frame 0 down to 0.0 (all B's) at the last frame. Linear by default - 0.9, 0.8, 0.7… - which produces a natural, cinematic transition. Same trick works for shot stitching or any time you're bridging two graded looks.
How it works
Mechanically it's identical to its sibling, per frame: matched_A and matched_B via the color-matcher library, blended by that frame's weight, then pulled toward the blend by strength. The difference is the ramp. For a batch of N frames:
t = i / (N-1)across the batch, then passed through the choseneasingweight_a = (1-t) × start_weight_a + t × end_weight_a
The defaults (start_weight_a 1, end_weight_a 0, easing linear) reproduce the A→B ramp above. Bump ease_power (1–5) to shape ease_in / ease_out / ease_in_out curves - it does nothing for linear or smoothstep.
There's also a u_shape strength mode worth knowing: with strength_mode set to u_shape, the match intensity stays high at the ends of the clip and dips toward mid_strength in the middle. It's a "pass through neutral" effect - handy when you don't want the middle of a transition to be strongly colored at all.
The inputs that matter
Required: the two references, the target batch, and method (same six color-matcher algorithms as the sibling node; mkl is the sane default).
The optional set is where the personality is:
- ref_a_batch_mode / ref_b_batch_mode - "first frame" or "last frame", telling the node which frame of a reference batch to use. Defaults (last for A, first for B) are already tuned for the three-clip setup.
- start_weight_a / end_weight_a / easing / ease_power - the ramp itself.
- strength / strength_mode / mid_strength / strength_easing - how hard the match pulls, and whether that varies across the clip.
- debug_print - dumps every per-frame weight to the console. Turn it on once before you blame the look.
Output is a single image tensor, batch-aligned with your target.
Installing & gotchas
Install is shared with the whole pack: ComfyUI Manager search "Comfyui-ColorMatchNodes", or cd ComfyUI/custom_nodes && git clone https://github.com/elyetis/Comfyui-ColorMatchNodes. Requires pip install color-matcher - the classic "Can't import color-matcher" error means that dependency didn't land.
Two traps specific to this node. First: unlike the sibling, references are collapsed to a single frame (first or last) - there's no per-frame ref matching here. If you need each target frame matched against a different reference frame, use ColorMatch2Refs with a batch instead. Second: for a batch of 1 it just applies start_weight_a, so don't test your ramp with a single frame and expect to see anything. And like its sibling, it's CPU-bound - a few hundred frames is fine with multithreading on, thousands will take a coffee break.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| image_ref_a | IMAGE | — | |
| image_ref_b | IMAGE | — | |
| image_target | IMAGE | — | |
| method | COMBO | mkl | 6 options: mkl, hm, reinhard, mvgd, hm-mvgd-hm, hm-mkl-hm |
| ref_a_batch_modeopt | COMBO | last frame | 2 options: first frame, last frame |
| ref_b_batch_modeopt | COMBO | first frame | 2 options: first frame, last frame |
| strengthopt | FLOAT | 1.000–10 | — |
| strength_modeopt | COMBO | constant | 2 options: constant, u_shape |
| mid_strengthopt | FLOAT | 0.500–10 | — |
| strength_easingopt | COMBO | linear | 5 options: linear, ease_in, ease_out, ease_in_out, smoothstep |
| multithreadopt | BOOLEAN | true | — |
| start_weight_aopt | FLOAT | 1.000–1 | — |
| end_weight_aopt | FLOAT | 0.000–1 | — |
| easingopt | COMBO | linear | 5 options: linear, ease_in, ease_out, ease_in_out, smoothstep |
| ease_poweropt | FLOAT | 2.01–5 | — |
| debug_printopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |