Tile ColorFix Patcher
The A1111 ColorFix toggle, as a ComfyUI node
- model
- ref_latent
- model
Somewhere in A1111's ControlNet extension there's a checkbox that fixes color drift during tiled upscaling, and most people never think about it twice. This node is that checkbox, ported to ComfyUI as a model patcher for SD and SDXL. It swaps the low-frequency color of a reference image into your generation every denoising step while leaving the model's own detail alone.
The formula is the same one from A1111's hook.py, and it's three operations:
fixed = x0 - blur(x0, k) + blur(reference, k)
Blur both latents, subtract the prediction's color, add the reference's color. weight (0–1) then blends between the fixed and original result, so 1.0 is a full color lock and 0.5 is a tint. The blur is a box filter - a straight average - because that's exactly what A1111 does. At blur_k=8 that's a 17×17 kernel, roughly 136px of blur in image space, which is why the parameter reads as "how far away can color wander before it's corrected".
The inputs that matter
ref_latent- VAE-encode your reference image and wire it in. For SDXL that's the SDXL VAE; for SD 1.5 the matching VAE for your checkpoint. Wrong VAE, wrong colors - this is the classic beginner trap with anything that touches latents.blur_k- frequency split point, default 8, range 3–32. Larger = more aggressive color transfer.weight- correction strength, 0–1, default 1. Full replacement at 1.0.blur_mode- box (A1111 original) is the default and gives an exact A1111 match. gaussian (smoother) exists because box blur's sharp frequency cutoff can produce patchy color artifacts when ColorFix runs without a tile ControlNet. If you're pairing this with a tile ControlNet (the usual setup), box is fine; standalone, try gaussian first.
Output is a single patched model - feed it to your KSampler instead of the raw one.
Install
Pure Python, no requirements.txt, no model downloads:
cd ComfyUI/custom_nodes
git clone https://github.com/ihorpankin/comfyui-colorfix-v3.git
Restart ComfyUI; it's under colorfix-v3. ComfyUI Manager: search "comfyui-colorfix-v3".
Where people get burned
Two things. First, this is a color lock, not a structure lock. In a tiled upscale the tile ControlNet (the pack's "Apply Ultimate ControlNet") keeps each tile faithful to the source; ColorFix keeps the colors consistent across tiles. People who run one without the other tend to blame the wrong node when tiles drift. Second, the patch is registered as a post-CFG sampler callback, so it does its work after CFG does its thing - if you're seeing color shift only on high-CFG renders, lower the CFG rather than fighting it here. And if you want detail enhancement on top of the color fix, the pack's +Sharp variant is the one that does that.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| ref_latent | LATENT | VAE-encoded control/reference image. Connect from VAE Encode node. This provides the color palette to transfer. | |
| blur_k | INT | 83–32 | Blur kernel radius (A1111 'Variation'). Controls frequency split point. Larger = more aggressive color transfer. k=8 → 17x17 kernel → ~136px blur in image space. |
| weight | FLOAT | 1.000–1 | Color fix strength. 0.0 = no correction, 1.0 = full color replacement. |
| blur_mode | COMBO | box (A1111 original) | Blur algorithm for frequency split. Box = A1111 exact match, sharp cutoff. Gaussian = smoother falloff, reduces patchy artifacts. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |