๐จ Color Match To Reference
Make Every Shot Look Like It Was Graded Together
- images
- reference_image
- IMAGE
The single most obvious tell of AI video is that every clip has a different color cast. Shot one is teal, shot two is warm, shot three has that weird green skin tone. ColorMatchToReference is the fix: it takes your frames and re-grades them so their color distribution matches a reference image you feed it. It's the node you reach for when you're stitching scene chunks into one video and want them to look like they were graded in the same session.
Mechanically it does LAB mean/std alignment - a technique that's been in every image-processing toolbox for years. It converts both images to LAB color space, computes the mean and standard deviation of each channel, then rescales your frames' color statistics to match the reference's. L, A, B roughly correspond to lightness, green-red, and blue-yellow, so this pushes your footage's overall tone, tint, and contrast range toward the reference without doing any per-pixel matching that would smear detail. The source leans on kornia for the LAB conversion, and runs the math on GPU.
The inputs that matter
- images - your frame tensor.
- reference_image - a single IMAGE to match against. This is the artistic input: pick the frame or still that has the look you want the whole video to share.
- match_strength - 0.0 to 1.0, default 1.0. This blends between your original frames and the fully-matched result. The gotcha: full-strength LAB matching can flatten things - your footage's contrast and saturation get squashed toward the reference's averages, which can look washed out if the reference is flat. Start at 1.0, but don't be surprised if 0.6โ0.8 is the sweet spot.
- batch_size - 1 to 500, default 1. Like the pack's other enhancement nodes, this controls how many frames are processed per pass, and it's your OOM dial on long videos. Bump it up if your GPU can handle it; drop it to 1 if you crash.
Output is a single IMAGE tensor, same shape as the input, ready to feed the next node in your enhancement chain.
Install
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl
Or search vrgamedev in ComfyUI Manager and install. Note this node specifically needs kornia - it's in the pack's requirements.txt, so let Manager install dependencies or run pip install kornia if you cloned manually and the node refuses to load.
Common issues
- Colors look washed or flat: back off
match_strengthto 0.5โ0.8. Full LAB matching is aggressive. - Skin tones drift: pick a reference with the skin tone you actually want - LAB matching will drag your footage's skin toward the reference's, which is great when intentional and a trap when your reference is a blue-lit action shot.
- OOM on long videos: lower
batch_size.
This is one of those nodes that looks unremarkable on paper and quietly does heavy lifting in the final result. A video where every scene matches a single grade reads as "cinematic"; a video where every scene has its own color cast reads as "AI." It's the difference between the two, and it's a single node.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | โ | |
| reference_image | IMAGE | โ | |
| match_strength | FLOAT | 1.000โ1 | โ |
| batch_size | INT | 11โ500 | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | โ |