Nodes/ComfyUI_LucidFlux/LucidFlux Color Align
ComfyUI Node

LucidFlux Color Align

Fixing LucidFlux Color Drift With One Node

By smthemex·Created about a year ago·Updated 6 days ago· 65
LucidFlux Color Align
  • image
  • reference
  • IMAGE
◄strength1.00►

Restoration models are liars about color. You feed a faded, slightly magenta scan into a diffusion-based restorer, it hands you back a beautifully sharpened image that is now a little too blue and two stops too dark. The detail is right, the tone is wrong, and no amount of re-rolling the seed fixes it because the model is confidently averaging toward its training distribution.

LucidFluxColorAlign is the band-aid. It's the last node on the 2K branch of the LucidFlux workflow, and its job is unglamorous: take the low-frequency color and brightness from a reference image and paste it back onto your diffusion output, keeping the diffusion output's high-frequency detail.

What it actually does

It's a wavelet decomposition, which sounds fancier than it is. The node splits both images into a blurred "low frequency" layer and a residual "high frequency" layer - detail, texture, edges - across five octaves. Then it rebuilds: content's high frequency plus reference's low frequency.

So the sharpness in your result is 100% the model's work, and the color, exposure and overall cast come 100% from the reference. That's exactly the split you want after restoration, because the reference image is the only thing in the graph that still knows what the original scene looked like. The pack's own comment calls this the official wavelet_reconstruction, and it is: the code in align_color.py is a line-for-line port of upstream's, stripped of its PIL/torchvision imports.

In the stock workflow the reference is wired from LucidFlux DiffBIR (SwinIR)'s ldr output - the SwinIR-restored version of your input, pre-diffusion. Which means the color you get back is the color SwinIR kept from your original photo. That's the whole trick.

The three inputs

image is what you're fixing - normally the output of VAEDecode.

reference is where the color comes from. Here's the part most people don't notice: there's nothing LucidFlux-specific about this input. Feed it any image at all and the node will happily borrow its palette. It's a legitimately useful generic color-transfer node that happens to ship inside a restoration pack.

strength runs 0 to 1, default 1. At 1 you get the full reference tonality. Below 1 it cross-fades back toward the un-aligned image, which is the setting you want when your reference is itself a bit off - say a seriously degraded source where the "correct" color is a guess. At 0 the node returns image untouched (the code short-circuits before touching the GPU), so you can leave it wired and A/B it by dragging one slider instead of deleting a wire.

One output: IMAGE. It goes to SaveImage, or to a LucidFluxPiDDecode if you're continuing to 4K. Sizing is handled - if the reference doesn't match the image's resolution it gets bilinear-resized to fit, and batches are matched up per item.

Installing it

This node ships in smthemex/ComfyUI_LucidFlux, not standalone. In ComfyUI Manager search the pack title, or:

cd ComfyUI/custom_nodes
git clone https://github.com/smthemex/ComfyUI_LucidFlux
# restart ComfyUI

The pack's only Python dependencies are torch and einops, both of which you already have if ComfyUI runs at all. No diffusers, no transformers. On startup the pack creates ComfyUI/models/LucidFlux/ for you, so don't panic when that folder appears.

Be warned though: if you installed this node to fix color on some other workflow, you've just pulled in a whole restoration pipeline's worth of model requirements you'll never use - the pack is built around a Flux-dev base plus a 3.4GB condition checkpoint. The node works with zero of those downloaded, but it's a heavy way to get a color match.

Where people get burned

The honest limitation is that the reference has to be trustworthy. This node can't tell a good exposure from a bad one; it just moves the low frequencies across. If your source scan is yellowed, LucidFlux Color Align will faithfully restore the yellow. The fix there isn't a stronger strength value, it's a manual color pass before SwinIR - or a strength somewhere around 0.5 to split the difference.

Second, mind the batch. Alignment runs one image at a time on the GPU, and the node upscales the reference to your output size first. If you're aligning a batch of eight 2K images, that's eight upscale-plus-wavelet passes stacked on top of everything else in VRAM - usually fine, occasionally the thing that pushes you over.

And don't expect it to rescue geometry. If the diffusion pass smoothed a face into wax or invented a window that isn't there, no color trick hides that. LucidFlux work is only as good as your SwinIR prior and your step count; this node is the last 5% of polish, not the 50% you were hoping for.

CategoryLucidFlux

Inputs (3)

NameTypeDefaultDescription
imageIMAGE—
referenceIMAGE—
strengthFLOAT1.000–1—

Outputs (1)

NameTypeDescription
IMAGEIMAGE—