Flux Tile ColorFix Patcher
Fix Flux's color drift without touching its detail
- model
- ref_latent
- model
If you've done tiled upscaling, you know the failure: every tile comes back slightly different - one greenish, one washed out, one with a color cast that has no business being there. That's the classic color drift problem, and A1111's ControlNet extension has been solving it for years with a toggle literally called "ColorFix". This node is that algorithm, ported to ComfyUI and rebuilt for Flux.
The idea is almost embarrassingly simple. Every denoising step, the generation's low-frequency color information gets replaced with the reference image's low-frequency color, while the high-frequency detail the model just invented is left alone. You keep the texture the model made, but the color palette comes from your source image.
How it works
Technically, the node patches your model with a post-CFG callback that runs at every denoising step:
fixed = x0 - blur(x0, k) + blur(reference, k)
Blur the prediction and the reference, subtract the prediction's blur, add the reference's blur. The weight input then blends between the corrected and uncorrected latent, so 1.0 is full color replacement and 0.5 is halfway. Detail survives because the blur only captures the color-bearing low frequencies - the high-frequency structure of the prediction is never touched.
Flux gets its own variant for two reasons. Its latents are 16-channel instead of SD/SDXL's 4, and it runs at cfg_scale=1.0 with guidance embedded, so the callback takes the simple no-CFG path. The reference latent is also scaled into Flux's internal latent space automatically via latent_format.process_in(), which is the kind of detail that makes or breaks these ports.
The inputs that matter
ref_latent- VAE-encode your reference image and feed it here. This is where people get burned: use the Flux VAE, not an SDXL one. A mismatched VAE means a wrong latent space and a wrong palette.blur_k- the frequency split point, default 8 (range 3–32). Higher = more aggressive color transfer. At k=8 the kernel is 17×17.weight- 0.0 is no correction, 1.0 is full color replacement. Start at 1.0 and dial back if you want the reference to be a suggestion rather than a law.blur_mode- default gaussian (smoother), which the author recommends for Flux.box (A1111 original)gives the exact A1111 result but has a sharp frequency cutoff that can go patchy when used without a tile ControlNet.
Output is a single patched model, which you feed to your KSampler in place of the unpatched model.
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/flux. ComfyUI Manager: search "comfyui-colorfix-v3".
Where people get burned
Besides the VAE mistake above: this fixes color, not composition. It's a palette lock, not a structure lock - that's what the tile ControlNet (the pack's "Apply Ultimate ControlNet (FLUX)") is for. The classic workflow runs both: ColorFix keeps the tiles consistent, tile ControlNet keeps them faithful. And if your source is a soft JPEG, expect the sharp version of this node to look more flattering; if you want detail back, that's the +Sharp patcher's job.
Inputs (10)
| 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. Use the Flux VAE for encoding. | |
| blur_k | INT | 83–32 | Blur kernel radius. Controls frequency split point. Smaller = stronger color but more of the reference's structure; larger = less of both. k=8 → 17x17 kernel. Tile mode only. |
| weight | FLOAT | 1.000–1 | Color fix strength. 0.0 = no correction, 1.0 = full color replacement. |
| blur_mode | COMBO | gaussian (smoother) | Blur algorithm for frequency split. Gaussian = smoother falloff, recommended for Flux. Box = sharp cutoff, A1111 original. |
| transfer_modeopt | COMBO | tile (spatial) | tile = swap blurred colors in place: colors follow the reference's layout (best when reference and output share composition, e.g. img2img/upscale). adain = match each latent channel's mean and spread: palette and tone only, no reference shapes (best for an unrelated reference). mean-only = shift tone, keep contrast. With adain, blur_k / blur_mode / blur_k_start apply only when tile_mix is above 0. |
| tile_mixopt | FLOAT | 0.000–1 | adain modes only. Share of tile transfer blended over the adain result. Higher = color closer to the reference's positions, but more of its layout. 0 = pure adain. |
| start_percentopt | FLOAT | 0.000–1 | Skip the color fix before this point of sampling. Early steps decide composition; 0.1-0.2 keeps the model's own pose and shapes instead of the reference's. 0.0 = fix from the first step. |
| blur_k_startopt | INT | 00–64 | Blur radius at the first fixed step, moving linearly to blur_k by the end. A large value (e.g. 32) passes only very coarse color while composition forms. 0 = use blur_k throughout. |
| blur_radius_pxopt | INT | 00–1024 | Blur radius in image pixels, converted using the model's latent downscale, so one value covers the same image area on every model. Overrides blur_k when above 0. 192 = blur_k 24 on FLUX.1/SDXL, blur_k 12 on FLUX.3 Klein. blur_k_start stays in latent pixels. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |