Nodes/ComfyUI-Image-Inpainting/ColorCorrection Inpaint
ComfyUI Node

ColorCorrection Inpaint

Making the inpainted patch stop looking foreign

By SherryXieYuchen·Created 2 years ago·Updated 2 years ago· 4
ColorCorrection Inpaint
  • image
  • reference
  • mask
  • IMAGE
factor1.00

"ColorCorrection Inpaint" exists for the one thing that makes an inpaint read as fake: the patch has the right shapes but the wrong color. The model generated content that's structurally correct, and it still looks like a sticker because its brightness, tint, and contrast don't match the surrounding image. This node transfers the color statistics of the untouched reference onto the inpainted result so the seam disappears.

The most common reason a patch looks pasted-on isn't the geometry, it's the color profile - VAE decode drift, model-specific saturation, lighting that doesn't line up. Rather than making you dial in a dozen manual curves, the node does a classic color-transfer: it measures the mean and standard deviation of each channel in the reference, measures the same in the target, then normalizes the target to match. The factor dial blends between "do nothing" (0) and "full transfer" (1), which is the default.

The inputs that matter

  • image - the inpainted result that needs fixing.
  • reference - the image whose color profile you want, almost always the original, pre-inpaint frame.
  • factor (default 1, range -10 to 10) - how hard the correction applies. 1 is usually right; values past 1 overshoot and start shifting the whole frame toward the reference's extremes. Negative values invert the effect, which is rarely what you want.
  • mask (optional) - marks the region you care about. Here's the neat part: the node computes its statistics from the unmasked area, not the masked one. So the mask says "this is my patch; match it to everything else in the frame." If you leave it empty, the stats come from the whole image.

In the bundled workflow it sits right after INPAINT_VAEDecode: the decoded diffusion output is the image, the preprocessed original is the reference, and the mask marks the region the sampler just drew. That ordering is the takeaway - you color-correct after you decode, and before you composite the patch back, so the blended result inherits the corrected colors.

Install

Same pack, same drill:

cd ComfyUI/custom_nodes
git clone https://github.com/SherryXieYuchen/ComfyUI-Image-Inpainting
# restart ComfyUI

Or Manager → search "ComfyUI-Image-Inpainting". No models of its own.

Where it can bite

The stats-based transfer assumes the reference and target are broadly similar in content. If your reference is a totally different scene, matching it will yank the colors somewhere ugly - keep the reference close to the target. And factor is a blunt instrument: if the patch still reads wrong at 1, the problem is usually a mask edge that's too sharp, so feather the mask (or feed it through a blur) before you expect this node to do magic.

Categoryimage

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
referenceIMAGE
factorFLOAT1.00-10–10
maskoptMASK

Outputs (1)

NameTypeDescription
IMAGEIMAGE