Nodes/ComfyUI-UtilsCollection/Image Match Properties
ComfyUI Node

Image Match Properties

Make the new shot match the old light

By silveroxides·Created 3 months ago·Updated a day ago· 36
Image Match Properties
  • original_image
  • generated_image
  • mask
  • image
overall_weight1.000
color_weight1.000
lighting_weight1.000
texture_preservation0.500
saturation_weight1.000
contrast_weight1.000

Color mismatch is the tell that gives away a composite: the subject looks generated because its white balance, temperature, and lighting don't match the scene around it. UC_ImageMatchProperties exists to kill that tell - it adjusts a generated image toward the color and lighting of a reference image while hanging onto the generated image's own detail.

This is the "match the insert to the plate" node for workflows that composite generated content into a real photo, or that chain two generations and want them to read as one lighting setup. The reference (original_image) provides the color story; the subject (generated_image) provides the texture; the output is the subject recolored into the scene.

How it works

It separates the adjustment into two independently-weighted axes: color_weight (default 1) steers the reference's color distribution, and lighting_weight (default 1) steers luminance. Both are multiplied by overall_weight (default 1) for a master strength. The clever part is texture_preservation (default 0.5): matching only low-frequency properties - the broad color and light fields - while leaving high-frequency edges and texture from the generated image untouched. That's the difference between "recolored to match" and "smudged into the scene." An optional mask softly confines the change to a region rather than the whole image.

The inputs that matter

  • original_image - the reference whose color/lighting you're matching.
  • generated_image - what gets adjusted.
  • overall_weight - the single "how much of this do I want" knob. Dial it back from 1 when the match looks overdone.
  • color_weight / lighting_weight - separate the two axes when only one is off.
  • texture_preservation - raise it if the match is eating detail; lower it if the match isn't reaching.

Single output: image.

Installing it

ComfyUI Manager → search "ComfyUI-UtilsCollection", or:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection

Restart. Pack deps are opencv-python and typing-extensions, no models or API keys. Newer-extension-API pack - keep ComfyUI current.

The beginner trap is cranking overall_weight to 1 with both color and lighting fully weighted and wondering why the subject now carries the reference's brightness structure - a bright scene will blow out your insert, a dark one will crush it. When the match fights you, drop lighting_weight first; color match is usually what you actually wanted. And remember it's a global color grade, not an illumination model - it won't relight a subject, it makes the light read as consistent.

Categoryadvanced/image

Inputs (9)

NameTypeDefaultDescription
original_imageIMAGEConnect the original image. The node automatically finds where it appears inside the larger result, including when its size changed.
generated_imageIMAGEConnect the outpainted image. Colors near the matched original-image edges are used to correct the whole result.
overall_weightFLOAT1.0000–3Strength of the complete correction. 0 keeps the generated image unchanged, 1 applies the measured correction, and values above 1 make every correction stronger.
color_weightFLOAT1.0000–3Matches the original image's overall color cast and balance. Values above 1 push the result farther toward those colors. It does not copy colors by pixel position.
lighting_weightFLOAT1.0000–3Matches the original image's overall brightness. Values above 1 make the brightness correction stronger.
texture_preservationFLOAT0.5000–1Keeps fine detail from the generated image while correcting contrast. Increase it if textures become too harsh or too soft.
maskoptMASKConnect the outpaint mask when available. White generated areas are measured and corrected; black original areas stay unchanged. The correction feathers automatically inside the generated edge. Leave disconnected for automatic edge matching and whole-image correction.
saturation_weightoptFLOAT1.0000–3Matches how vivid or muted the original image is. Values above 1 strengthen the saturation correction; lower it if the result becomes too colorful.
contrast_weightoptFLOAT1.0000–3Matches the difference between dark and bright areas in the original image. Values above 1 strengthen the contrast correction; lower it if shadows or highlights become too strong.

Outputs (1)

NameTypeDescription
imageIMAGE