Nodes/Comfyui-ColorMatchNodes/Color Match 2Refs Blend AutoWeights
ComfyUI Node

Color Match 2Refs Blend AutoWeights

Auto-Ramping a Two-Reference Match Across Frames

By elyetis·Created 10 months ago·Updated 9 months ago· 5
Color Match 2Refs Blend AutoWeights
  • image_ref_a
  • image_ref_b
  • image_target
  • image
methodmkl
ref_a_batch_modelast frame
ref_b_batch_modefirst frame
strength1.00
strength_modeconstant
mid_strength0.50
strength_easinglinear
multithreadtrue
start_weight_a1.00
end_weight_a0.00
easinglinear
ease_power2.0
debug_printfalse

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 chosen easing
  • weight_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.

CategoryElyetis/image

Inputs (16)

NameTypeDefaultDescription
image_ref_aIMAGE
image_ref_bIMAGE
image_targetIMAGE
methodCOMBOmkl6 options: mkl, hm, reinhard, mvgd, hm-mvgd-hm, hm-mkl-hm
ref_a_batch_modeoptCOMBOlast frame2 options: first frame, last frame
ref_b_batch_modeoptCOMBOfirst frame2 options: first frame, last frame
strengthoptFLOAT1.000–10
strength_modeoptCOMBOconstant2 options: constant, u_shape
mid_strengthoptFLOAT0.500–10
strength_easingoptCOMBOlinear5 options: linear, ease_in, ease_out, ease_in_out, smoothstep
multithreadoptBOOLEANtrue
start_weight_aoptFLOAT1.000–1
end_weight_aoptFLOAT0.000–1
easingoptCOMBOlinear5 options: linear, ease_in, ease_out, ease_in_out, smoothstep
ease_poweroptFLOAT2.01–5
debug_printoptBOOLEANfalse

Outputs (1)

NameTypeDescription
imageIMAGE