PiD Decode
Swap your VAE Decode for a pixel-diffusion decoder
- latent
- image
The one-node PiD experience. PiD Decode takes a LATENT, a caption, and a sigma, and produces an IMAGE - no separate VAE Decode node, no staged pipeline. It's the cleanest way to test whether NVIDIA's Pixel Diffusion decoder is for you: replace your decode step and see what comes out.
The idea is simple. Your model's VAE decoder is deterministic: latent in, pixels out, and whatever the autoencoder smoothed away is gone for good. PiD instead runs pixel diffusion - a distilled diffusion model that treats "decode" as a small denoising problem conditioned on your caption, and in doing so combines the decode with a 4x upscale. That's why a 512-class latent can come out as a 2048x2048 image. The trade, which you should internalize: it doesn't reconstruct faithfully, it reinterprets. Detail that was never in the latent can appear. Think of it as an upscaler-shaped decoder, not a lossless swap.
How the decode works
PiD Decode is the whole pipeline in one node. It validates your latent against the chosen backbone (channel count and downscale must match), loads the native Comfy-Org PiD diffusion model plus the Gemma text encoder, and runs the distilled 4-step decode. It pulls the effective sigma from the latent if it carries one (see PiD KSampler Capture), otherwise from the sigma input. Then it converts the pixel-space result back into a ComfyUI image.
Inputs a beginner actually sets
latent- from your sampler. If it came out ofPiD KSampler Capture, the node uses the capturedpid_sigmaautomatically; otherwise setsigmayourself.backbone- the model family your latent belongs to. This is the one that bites people: a Flux latent is 16-channel, Flux2 is 128-channel, SDXL is 4-channel, and each has a different downscale. Feed the wrong one and the node errors immediately rather than guessing.pid_ckpt_type-2k(512-class latent → ~2048 out) or2kto4k(1024-class latent → ~4096 out).pid_steps- the decode's denoising steps, default4. These checkpoints are 4-step distilled, so 4 is the sweet spot; other values get a warning that you're out of distribution.cfg_scale- default1.0, which is the right call for a distilled model. This is not your LDM CFG; leave it alone unless you're experimenting.scale-0or4are the recommended values (4 is the native checkpoint scale; 0 is the latent resolution itself).caption- PiD is conditioned on text, so a caption helps a lot. WirePiD Text PromptorPiD Caption Creatorin.model_precision-bf16for quality;fp8only where supported (Flux1-family and Flux22k);int8for v1.5.
There's also unload_comfy_before_pid and aggressive_cleanup, both default true, which free the main model's VRAM before PiD loads and aggressively clear memory after. Leave them on; they're why the node survives on mid-range cards.
The workflow
model + KSampler -> LATENT -> PiD Decode -> Save Image
Or the capture-first variant if you want PiD to start from a partially denoised latent:
PiD Text Prompt -> CLIP Text Encode -> PiD KSampler Capture -> PiD Decode -> Save Image
Setup and gotchas
Install once for the whole pack: ComfyUI Manager → search "ComfyUI-PiD", or
cd ComfyUI/custom_nodes
git clone https://github.com/Merserk/ComfyUI-PiD.git
cd ComfyUI-PiD
python -m pip install -r requirements.txt
then restart. Requirements: recent ComfyUI with native PixelDiT support (0.28.0+), Python 3.10+, NVIDIA GPU. Models auto-download to ComfyUI/models/diffusion_models/nvidia_pid/ and text_encoders/nvidia_pid/ on first run with auto_download on.
Common issues: a 4K decode eats VRAM, so prefer 2k first; unsupported backbone/model_precision combos error instead of falling back (that's intentional - don't fight it, just switch to bf16); and remember PiD can add detail that wasn't in the latent, which is a feature for upscaling and a bug if you expected a faithful decode.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — | |
| version | COMBO | v1 | 2 options: v1, v1.5 |
| backbone | COMBO | zimage | 10 options: zimage, zimage-turbo, flux, flux2, flux2-klein-4b, flux2-klein-9b, +4 |
| pid_ckpt_type | COMBO | 2k | 2 options: 2k, 2kto4k |
| pid_steps | INT | 41–64 | — |
| scale | INT | 00–8 | — |
| cfg_scale | FLOAT | 1.00–20 | — |
| sigma | FLOAT | 0.0000–1000 | — |
| seed | INT | 00–2147483647 | — |
| auto_download | BOOLEAN | true | — |
| model_precision | COMBO | bf16 | 3 options: bf16, fp8, int8 |
| unload_comfy_before_pid | BOOLEAN | true | — |
| aggressive_cleanup | BOOLEAN | true | — |
| caption | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |