LucidFlux_SM_Pid_Decoder
PiD pushes the restored latent up to the wall
- pid_model
- latent
- images
- image
What it is
LucidFlux_SM_Pid_Decoder is where LucidFlux stops being a restoration and becomes a 4K upscaler. It's the decode stage of the PiD path: it takes the restored latent from LucidFlux_SM_KSampler, runs it through NVIDIA's PiD pixel-space diffusion decoder, and hands you back a 2K or 4K image. This is the "wow, look at the resolution" node, and also the one that will make your GPU beg for mercy.
How it works
Mechanically, PiD replaces the normal VAE-decode-with-upscale with a 4-step distilled Flux-family diffusion decoder that decodes and upscales in a single learned pass. ## The knobs
The node drives a PiDFluxDecoder loaded by LucidFlux_SM_Pid_Model and gives you a handful of knobs that mostly map to PiD's own settings:
- pid_model: the bundle from LucidFlux_SM_Pid_Model. It also reads your
pid_typeoff it (2k vs 2kto4k), so the checkpoint choice there decides the scale here. - latent: from the KSampler. Same story as the normal decoder - this latent carries the source images inside, which the color alignment needs.
- steps: default 4. PiD is a 4-step distilled model; that's not a suggestion, it's the design. More steps mostly costs time.
- seed: reproducibility, same as everywhere.
- cfg: default 1.0. That's effectively no CFG, which is normal for a distilled model - the guidance is baked into the weights. Leave it.
- degrade_sigma: 0 to 1, default 0. Adds back a bit of controlled noise during decode; the original PiD inference uses it as a mild "degradation" input. 0 is fine to start.
- pid_color_align_strength: 0.1 to 1, default 0.6. This is the color-lock strength - how hard the decode stays true to the source's colors. If your upscaled output starts drifting in hue, push this up.
- streaming_prefetch_count: default 1. Controls how far ahead the layer-streaming scheduler fetches weights - the mechanism that lets a 4K diffusion decode run on a single card. Set it to 0 and the node moves the whole PiD model onto the GPU instead of streaming, which is faster but a VRAM bomb.
- wavelet: default on. Same wavelet color-alignment pass as the normal decoder - keeps the source's low-frequency color while PiD supplies the high-frequency detail.
- images (optional): the source image. If you feed a stock latent (not one of this pack's baggaged latents) and you want color alignment, you must connect this, or the node refuses with "need link origin image to align color."
Output: image, an IMAGE you can preview and save. That's the money shot.
Install
Install is the pack's shared routine plus the PiD downloads: clone smthemex/ComfyUI_LucidFlux into custom_nodes, pip install -r requirements.txt, restart; put the .pth in models/diffusion_models/ and gemma_prompt_embedding.pt + null_caption_embs.pt in models/LucidFlux/. Missing gemma_prompt_embedding.pt will hard-fail the load with a file-not-found, so that's the first thing to check when this node errors.
Expectation-setting
Expectation-setting, because this is the node people overreach on: the author's own note says the 2k path is mediocre and exists for 512→2048 pushes; the real deal is 2kto4k, and it wants VRAM. On a 12GB card you'll get there with streaming, slowly; on 8GB the 4K path is more a hobby than a workflow. And remember the whole stack - this pack's Model, Encode, and KSampler feeding a PiD decode - rides a FLUX.1-dev base, which is non-commercial. Great tool for restoring your own photos; not something to wrap in a paid service.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| pid_model | MODEL | — | |
| latent | LATENT | — | |
| steps | INT | 41–10000 | — |
| seed | INT | 00–2147483647 | — |
| cfg | FLOAT | 1.00–100 | — |
| degrade_sigma | FLOAT | 0.00–1 | — |
| pid_color_align_strength | FLOAT | 0.60.1–1 | — |
| streaming_prefetch_count | INT | 10–2147483647 | — |
| wavelet | BOOLEAN | true | — |
| imagesopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |