Color Match (Masked)<div style="font-size: 0.8em"><div id="Y7_shortdesc" style="margin-bottom: 15px;">Color matches the target image to a reference while excluding masked regions from the calculation.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Ideal for correcting color shifts after inpainting. The mask excludes regions (like the inpainted area) from BOTH images during color transfer calculation, preventing the original colors from bleeding into the result.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Example: After changing a red car to blue via inpainting, the background may have a red tint. This node calculates color correction using only the non-masked areas, then applies it without affecting the inpainted region.</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Inputs:</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">image_ref</code>: Reference image (e.g., original before inpainting)</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">image_target</code>: Target image to color match (e.g., result after inpainting)</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">mask</code>: Mask where white (1.0) = areas to exclude from color matching</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">method</code>: Color transfer algorithm - <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">mkl</code> (Monge-Kantorovich), <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">hm</code> (histogram), <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">reinhard</code>, <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">mvgd</code> (Multi-Variate Gaussian)</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">strength</code>: Blend between original and color-matched result (0.0 = no change, 1.0 = full correction)</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">feather</code>: Blur radius for mask edges to create smooth transitions (0-100 pixels)</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Output:</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 20px; font-size: 12px;">- <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">image</code>: The color-matched result with masked areas preserved unchanged</div></div><div style="font-size: 0.8em"><div style="margin-bottom: 8px; margin-left: 0px; font-size: 12px;">Requires the <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">color-matcher</code> library: <code style="border: 1px solid #666; border-radius: 3px; padding: 0px 1px; font-family: monospace; display: inline-block;">pip install color-matcher</code></div></div>
By yushan777·Created about a year ago·Updated 23 days ago· 7
Y7 Color Match (Masked)
image_ref
image_target
mask
image
◄methodmkl►
◄strength1.00►
◄feather0►
CategoryY7Nodes/Image
Inputs (6)
Name
Type
Default
Description
image_ref
IMAGE
Reference image for color matching (e.g., original before inpainting)
image_target
IMAGE
Target image to apply color correction to (e.g., result after inpainting)
method
COMBO
mkl
Color transfer method: mkl (Monge-Kantorovich), hm (histogram), reinhard, mvgd (Multi-Variate Gaussian)
maskopt
MASK
Mask where white (1.0) = areas to exclude from color matching (e.g., inpainted region). If not provided, color matching is applied to the entire image.
strengthopt
FLOAT
1.000–1
Blend strength between original and color-matched result (0=no change, 1=full correction)
featheropt
INT
00–100
Feather/blur radius for the mask edge transition in pixels