Nodes/ComfyUI_LucidFlux/LucidFlux_SM_Decoder
ComfyUI Node

LucidFlux_SM_Decoder

Turning the restored latent back into pixels — and why 'wavelet' should stay on

By smthemex·Created 11 months ago·Updated 3 months ago· 62
LucidFlux_SM_Decoder
  • latent
  • ae
  • images
vae
wavelettrue

What it is

LucidFlux_SM_Decoder is the last stop on the standard (1K/2K) path: it takes the restored latent from LucidFlux_SM_KSampler and turns it back into an image you can save. Every example workflow ends here or at the PiD decoder, and it's one of the few nodes in this pack where a single checkbox is doing most of the interesting work.

The mechanism is worth understanding because it explains a color bug people hit. The sampler's latent isn't a plain FLUX latent - it carries the original input images inside it, and the decoder uses that. When wavelet is on, the decode runs a wavelet reconstruction pass: it takes the VAE-decoded result's high-frequency detail and stitches it onto the original image's low-frequency (color and broad structure). In other words, the VAE invents the fine detail, but the original image keeps ownership of the colors. That's why restored output from this pack doesn't drift into weird green or magenta casts the way naive latent restores often do - it's a color-alignment trick, straight out of the align_color module in the source.

The inputs

The inputs:

  • vae: a combo of files in models/vae/. The README points you at ae.safetensors from Comfy-Org, or the optional UltraFlux VAE (Owen777/UltraFlux-v1) - the node auto-detects UltraFlux by its weights and switches the decode math accordingly. The 2K example uses UltraFlux; the 1K example uses plain ae.safetensors.
  • latent: from LucidFlux_SM_KSampler. It's the one that carries images and the infer_2k flag inside, which is why the node knows what to color-align against.
  • wavelet: default on. Leave it on. Turning it off gives you the raw VAE decode, which is faster but loses the color lock to the source.
  • ae (optional): a VAE input instead of the combo picker - feed an already-loaded ComfyUI VAE if your graph has one hanging around. If it's set, it takes precedence over the vae combo.

Output: images, an IMAGE you can preview, save, or pipe onward (the 2K path sometimes feeds it into the PiD 4K stage).

Install

Install is the pack's shared routine: git clone https://github.com/smthemex/ComfyUI_LucidFlux into custom_nodes (or search it in ComfyUI Manager), pip install -r requirements.txt, restart ComfyUI, then put ae.safetensors in models/vae/. This node specifically needs that file, and it's a gated download from Comfy-Org's model repo - log in on Hugging Face or grab the pre-mirrored copies floating around.

The trap

The one real trap: don't swap in a stock VAE Decode node to "save a step." The latent this pack produces is not shaped like a stock Flux latent - it's built for this decoder's internal bookkeeping (the carried images, the scaling-factor and shift-factor handling, the UltraFlux branch). Run it through the stock node and you'll get either a tensor-shape error or an image with the color lock missing. Keep the pair together: KSampler from this pack, Decoder from this pack.

Also worth a beat on expectations: at 1K the result is genuinely better than the raw input on damaged photos, but the showcase resolution is the 2K path with the UltraFlux VAE. If you've got the VRAM, that's the combination to reach for - the decoder is where the "universal restoration" money actually gets paid out.

CategoryLucidFlux_SM

Inputs (4)

NameTypeDefaultDescription
vaeCOMBO1 options: none
latentLATENT
waveletBOOLEANtrue
aeoptVAE

Outputs (1)

NameTypeDescription
imagesIMAGE