Nodes/ComfyUI-UtilsCollection/Image Match Properties (Legacy)
ComfyUI Node

Image Match Properties (Legacy)

Make a generated image inherit the reference's color and light

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Image Match Properties (Legacy)
  • original_image
  • generated_image
  • mask
  • image
overall_weight1.000
color_weight1.000
lighting_weight1.000
texture_preservation0.500

Your img2img pass nailed the composition but the colors drifted - too warm, too flat, or the lighting doesn't match the scene you're compositing into. Image Match Properties (Legacy) is the correction step that needs no model and no re-sampling: it takes a reference image and a generated image, and remaps the generated one's color and luminance toward the reference while leaving the actual detail alone.

The mechanism is histogram matching in LAB color space, done carefully. LAB splits an image into a luminance channel (L) and two color channels (a, b), which is exactly the split you want for this job - the node can match color without wrecking brightness and vice versa. It matches the L histogram for lighting and the a/b histograms for color, then blends the result back toward the generated original using your weight knobs. The texture_preservation trick is the interesting bit: when it's above 0, the node runs a bilateral filter to separate low-frequency "base" lighting from high-frequency texture, matches only the base, and lays the generated image's own texture back on top. That's how you match the mood without turning the image into a featureless smear.

The inputs that matter

  • original_image - the reference whose color/lighting you're copying.
  • generated_image - the one being adjusted. It keeps its detail; only the color/lighting moves.
  • overall_weight - master strength, multiplied into both color and lighting adjustments. 1.0 default.
  • color_weight / lighting_weight - how much of each adjustment, before the overall weight is applied. Useful when the colors are right but the light's wrong (or vice versa).
  • texture_preservation - keeps generated edges and texture crisp by only matching low frequencies. 0.5 default; push toward 1 for maximum detail retention.
  • mask - optional, softens the changes onto only part of the generated image.

The output

A single image, same size as the generated input, with the reference's color/lighting characteristics blended in. Wire it where you would have wired the generated image - before compositing, before saving.

Installing it

Part of silveroxides/ComfyUI-UtilsCollection. ComfyUI Manager → search ComfyUI-UtilsCollection → install → restart, or:

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

Restart after. Dependencies: opencv-python (this is a pure OpenCV job) and typing-extensions. No models. "(Legacy)" marks the compat alias for the pack's canonical UC_ImageMatchProperties.

Where people get burned

It's a color match, not a color transfer - don't expect it to import a reference's exact palette or its subject's skin tone, because it's matching distributions, not semantics. The other classic failure is matching a reference that's wildly different in composition or exposure; histograms don't care about where things are, so a backlit reference will drag your well-lit image toward its shadows. And if the output looks mushy, your texture_preservation is too low - that knob is the difference between "matching the mood" and "blurring the image."

Categoryadvanced/image

Inputs (7)

NameTypeDefaultDescription
original_imageIMAGEReference image whose color and lighting properties are matched.
generated_imageIMAGEImage adjusted toward the reference while retaining its generated detail.
overall_weightFLOAT1.0000–1Overall strength multiplying both color and lighting adjustments.
color_weightFLOAT1.0000–1Strength of reference color matching before the overall weight is applied.
lighting_weightFLOAT1.0000–1Strength of reference luminance matching before the overall weight is applied.
texture_preservationFLOAT0.5000–1Preserves edges and textures from the generated image by matching only low-frequency properties.
maskoptMASKOptional mask to softly blend the color/lighting changes onto the generated image.

Outputs (1)

NameTypeDescription
imageIMAGE