Color Match π
The fix for 'that inpainted region is slightly too bright'
- image
- reference
- mask
- image
Every outpaint or inpaint eventually hits the same wall: the patched region comes back a hair brighter, a touch cooler, or just off compared to the plate around it. Re-rolling the seed is the wrong tool - that's the thing the knowledge base keeps hammering, and it's right: a statistics transfer is deterministic and instant, a regeneration is neither. Color Match π is the deterministic fix.
It transfers the reference image's color statistics onto your input. The default lab method moves per-channel mean and standard deviation in LAB space, which is the perceptual-friendly, "make this look like that" default. rgb does the same math in raw channels, mkl maps the full covariance (better when hues are rotated rather than just shifted), and histogram matches each channel's distribution exactly - the strongest, least subtle option. For the classic use case, lab at strength 1.0 is where you start.
The two inputs that make it useful
reference is the image whose colors you want to copy - for an inpainted crop, feed it the original untouched image. It broadcasts across a batch, so one reference serves a whole video's worth of frames.
mask is where this node gets clever, and it's also the thing that trips people up. The mask restricts both the statistics measurement and the correction to its white area - perfect for recoloring just an inpainted region instead of the whole frame. Black pixels pass through bit-identical. Here's the catch: the node has no mask output. That's not a bug. The mask only scopes the fix; it doesn't change your mask, so you keep wiring your original mask onward and don't need it echoed back. invert_mask flips which side gets corrected, and strength blends between the original and the fully matched result - 0.3 is a gentle nudge, 1.0 is a full takeover.
The video trick
For video there's reference_mode: first_frame, which locks every frame to the batch's own first frame as the target. That's the one-node flicker fix: instead of each frame being matched against a static reference, they're all pulled toward a single anchor so colors stop breathing across the clip. No reference input needed.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/ausboss/ComfyUI-AusBoss.git
Restart ComfyUI and search for AusBoss (also in Manager under the pack title). No extra Python dependencies; the pack uses Pillow and NumPy that ship with ComfyUI. Minimum ComfyUI is 0.27.1.
Troubleshooting
If the match is too aggressive, that's what strength is for - a feathered inpaint seam usually wants 0.5β0.8, not 1.0. If hues look rotated rather than shifted, switch lab to mkl. And if your mask correction is landing on the wrong side of the frame, you've got invert_mask backwards, which is the most common mistake here. One real limitation: a plain statistics transfer can't fix a fundamentally different white balance or lighting angle - that's a regrade, not a match.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | BHWC image whose colors get corrected. | |
| strength | FLOAT | 1.000β1 | Blend between the original (0) and the fully matched image (1). |
| referenceopt | IMAGE | The image whose color statistics to copy β for an inpainted crop, feed the original image here. A single reference broadcasts across a batch. Required unless reference_mode is first_frame. | |
| methodopt | COMBO | lab | How the colors move. lab: perceptual mean/std shift, the safe default. rgb: the same in raw channels. mkl: full covariance mapping, best when hues are rotated, not just shifted. histogram: exact per-channel distribution match, the strongest and least subtle. |
| maskopt | MASK | Restricts the correction to the white area β both the statistics measured on the image and where the fix is applied; typical for recoloring just an inpainted region. Black pixels pass through bit-identical, so the mask itself never changes β wire your original mask onward. Without a mask the whole image is matched. | |
| invert_maskopt | BOOLEAN | false | Treat the mask's black area as the region to correct instead of the white area. |
| reference_modeopt | COMBO | reference | Where the target statistics come from. reference uses the connected reference image. first_frame uses the batch's own first frame as the target for every frame β locks a video's color in place to kill flicker; the reference input is ignored. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The color-matched image; pixels outside the mask are untouched. |