Nodes/ComfyUI_LucidNFT/LucidNFT_SM_Decoder
ComfyUI Node

LucidNFT_SM_Decoder

The Flux AE decode — and the wavelet trick that fixes the color shift

By smthemex·Created 6 months ago·Updated 6 months ago· 20
LucidNFT_SM_Decoder
  • latent
  • ae
  • image
vae
wavelettrue

The README's most emphatic warning is about this node, and it's worth repeating because it's the kind of thing you'd never guess: decoding the latent through ComfyUI's standard Flux AE path gives you a slight color difference - a cast that makes the restoration look off even though nothing is actually wrong with it. LucidNFT_SM_Decoder exists to give you a good decode, and its wavelet toggle is the fix for that cast.

How it works

Two ways to decode, both using the Flux AE. If you connect the optional ae input (a Flux AE loaded through a normal VAELoader - the example uses one), the node re-applies the Flux AE input normalization to the latent (the x/0.3611 + 0.1159 unscaling), decodes, and then - with wavelet on - runs a wavelet-domain color transfer. If you instead pick a Flux AE from the vae combo (the ae.safetensors in models/vae/), it loads it through the pack's own Flux util and does the same thing. Either way, what the wavelet stage does is take the detail from the decoded image and the low-frequency color from the LR reference image that the sampler stashed in the latent dict, and recombine them. Detail from the diffusion, color from the source - that's how you kill the cast without losing the restoration.

Flip wavelet to false and you get the plain decode, cast included. That's sometimes the right call if you're going to grade colors downstream anyway, but for a straight "does this look right" run, keep it on.

Inputs and output

  • vae - combo over your vae folder; pick ae.safetensors. You need either this or the ae input populated. Set neither and the node throws NotImplementedError("vae") - it's the one hard failure mode.
  • latent - the output of LucidNFT_SM_KSampler. Must be from this pack: the wavelet stage reads the LR reference image out of the latent dict, and a generic KSampler's latent won't have it.
  • wavelet - default true. The color-fix toggle described above.
  • ae (optional) - a VAE from a VAELoader, i.e. the path the example workflow uses.

The single image output is 0–1 RGB, ready for SaveImage or any normal downstream node.

Setup notes

Same pack install (clone, pip install -r requirements.txt, restart). The ae.safetensors comes from Comfy-Org's models repo and goes in models/vae/. Worth knowing: the README's "remember to star LucidNFT" note sits right next to the decode advice, which tells you the authors consider the color handling a known weak spot of the naive path - this node is the mitigation, not the bug. If your output looks washed out or tinted and you're decoding elsewhere, that's your sign to route the latent through here with wavelet on.

CategoryLucidNFT

Inputs (4)

NameTypeDefaultDescription
vaeCOMBO1 options: none
latentLATENT
waveletBOOLEANtrue
aeoptVAE

Outputs (1)

NameTypeDescription
imageIMAGE