Tiled Image Color Correction
Kill the seam lines — pull every sampled tile back toward the source's colors
- tiled_images
- reference_tiles
- corrected_tiles
Tiled upscaling has a tell: the tiles come back from the KSampler looking great individually and subtly wrong together - one tile slightly warmer, the next a bit brighter, and where they meet, a visible seam. That drift is the number-one reason tiled results look patchwork instead of photographic. Tiled Image Color Correction is the fix: it corrects each sampled tile against the original source tile so every piece lands on the same palette before the merge node stitches them.
This is the step the upscaling playbook keeps warning about - skip it and you get exactly the "patchwork artifacts" that give tiled diffusion a bad name. The pack even feeds you the reference: ImageCropTiles outputs a cropped_full_image precisely so you have the pristine source for this correction.
How it works
For each tile, it compares your sampled tile to the corresponding original (reference_tiles - same count, same order) and pushes the sampled tile's colors toward the reference. Three methods, from the source:
- histogram_match (default) - full per-channel histogram matching. The strongest correction; good when tiles drifted a lot.
- Color Transfer - mean & std matching in CIE LAB space (Reinhard 2001). More conservative, preserves contrast character better.
- none - skip.
On top of that: luminance_correction_strength matches brightness/contrast after the color pass (0 = skip, 1 = full), and edge_preserving_smooth (0.3–0.5 recommended) applies a final smoothing that reduces the color stains and artifacts the correction can leave behind.
The inputs that matter
- tiled_images - the sampled tiles, post-KSampler, pre-merge.
- reference_tiles - the original tiles before sampling (the
tiled_imagesoutput fromImageCropTiles). Same tile count astiled_images, or the node has nothing to correct against. - color_correction_method - histogram_match or Color Transfer; start with the default.
- color_correction_strength (default 1) - 0 = no correction, 1 = full. Dial back if corrected tiles start to look flat.
- luminance_correction_strength - add brightness/contrast matching on top; handy when tiles vary in exposure rather than hue.
- edge_preserving_smooth - artifact cleanup; 0.3–0.5 is the sweet spot.
One output: corrected_tiles, feeding straight into OverlappedImageMerge.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/mirabarukaso/ComfyUI_MiraSubPack
or search "MiraSubPack" in ComfyUI Manager and restart. No extra dependencies - the histogram and LAB math is all implemented in the pack.
Notes and gotchas
- Order matters and count must match. Tiles are corrected positionally, so if
reference_tilesandtiled_imagesdon't line up you'll correct tile 4 against tile 6's source. Keep both outputs from the same pipeline run. - Don't overdo the strength. Full histogram match (1.0) on a source that was heavily regenerated can flatten the detail the sampler just added - this node is for color fidelity, not for erasing the upscale. If seams persist at 1.0, the drift is big enough that you should fix your denoise or per-tile prompts instead.
- Use it as the default, not the exception. In a Mira ITU loop, this node between the KSampler and the merge is cheap and nearly always improves the result. The only case to skip it is when you want tiles to keep their independently generated look.
- If you see color stains at tile borders after correction, nudge
edge_preserving_smoothup rather than turning the method off.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| tiled_images | IMAGE | Sampled tiled images to be corrected (post-ksampler). | |
| reference_tiles | IMAGE | Original tiles before ksampler (e.g. tiled_images output from ImageCropTiles). Must have the same tile count as tiled_images. | |
| color_correction_method | COMBO | histogram_match | Color correction method applied to each tile: none: Skip color correction. Histogram Match: Full per-channel distribution matching. Color Transfer: Mean & std matching in CIE LAB space (Reinhard 2001). |
| color_correction_strength | FLOAT | 1.000–1 | Blend strength for color correction: 0=no correction, 1=full correction. |
| luminance_correction_strength | FLOAT | 0.000–1 | Blend strength for luminance (brightness+contrast) correction applied AFTER color correction. 0=skip, 1=full luminance match. Can be combined with any color_correction_method. |
| edge_preserving_smooth | FLOAT | 0.00–1 | Optional edge-preserving smoothing to reduce color artifacts/stains. 0=no smoothing, 0.3-0.5=recommended for artifact reduction, 1.0=maximum smoothing. Applied as final post-processing step. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| corrected_tiles | IMAGE | — |