PiD Super-Resolution Decode
PiD (Pixel Diffusion Decoder) is an alternative way to turn a model’s latents into an image. Instead of the usual VAE decode, it runs a short pixel-space diffusion that produces a 4× super-resolved result in a single, few-step pass — so a 512×512 generation comes out as a detailed 2048×2048 image.
Because it decodes in pixel space and is conditioned on your prompt, PiD often recovers finer texture and edge detail than a plain VAE decode followed by an upscaler.
Supported models
Section titled “Supported models”PiD works with these base models:
| Base model | PiD decoder to install |
|---|---|
| FLUX.1 | PiD Decoder FLUX |
| FLUX.2 Klein (4B / 9B) | PiD Decoder FLUX.2 |
| Stable Diffusion 3 | PiD Decoder SD3 |
| SDXL | PiD Decoder SDXL |
| Z-Image / Z-Image Turbo | PiD Decoder FLUX (Z-Image shares FLUX.1’s VAE) |
| Qwen-Image | PiD Decoder Qwen-Image |
What you need to install
Section titled “What you need to install”PiD needs two extra models, both available in Model Manager → Starter Models:
- A PiD Decoder for your base model (e.g. PiD Decoder FLUX (2K)). Some bases offer a 2K and a 2K-to-4K preset; SDXL and Qwen-Image ship only the 2K-to-4K preset.
- The Gemma 2 2B (PiD caption encoder) — PiD uses it to condition the decode on your prompt. It installs automatically as a dependency of any PiD decoder, and is shared across all of them.
Each PiD decoder is roughly 5 GB and the shared Gemma-2 encoder is roughly 5 GB.
The Gemma-2 caption encoder can also be a single-file GGUF (e.g. gemma-2-2b-it-Q4_K_M.gguf) that you install manually: InvokeAI loads it natively, keeping the large projection weights quantized instead of expanding them in memory, which cuts the encoder’s footprint noticeably. Only Gemma-2-2b GGUFs are accepted — PiD’s caption projection is fixed to their 2304-dim hidden state.
Enabling PiD
Section titled “Enabling PiD”Open the Generation settings for a supported model and expand the advanced options. You’ll find a PiD control with three modes:
Standard VAE decode. No PiD models required.
Generate at the requested size, decode 4× with PiD, then downscale the result back to the requested size. This is the safe default and works everywhere — the output matches your bounding box exactly, so it composites cleanly on the Canvas.
Treat the requested dimensions as the 4× target: the image is generated at target ÷ 4 and PiD’s full 4× output is used directly (no downscale), preserving all of the added detail. Great when you want a large, highly-detailed result.
When PiD mode is not Off, pick your PiD Decoder and Gemma-2 Encoder below the mode selector. The PiD Steps control (default 4) sets how many decode steps run — the released checkpoints are trained for 4.
PiD is available in both the Generate tab (text-to-image) and on the Canvas (image-to-image), in both Fit and Native modes.
Running PiD on an existing image
Section titled “Running PiD on an existing image”Everything above describes PiD as a decode step: it needs the latent the model just produced, so it only exists inside a generation. If you want to push an image you already have through PiD, the Workflow editor has a separate PiD Upscale (4x) node.
It encodes your image with the FLUX VAE and hands the resulting latent to the PiD decoder, giving a 4× result in one pass — the PiD analogue of an ESRGAN / SUPIR upscale. Connect a FLUX VAE, a FLUX PiD decoder and the Gemma-2 encoder, and optionally give it a caption describing the image (the decoder is caption-conditioned; an empty caption is the cheapest option but usually the weaker result).
Tips & limitations
Section titled “Tips & limitations”On GPUs with limited VRAM, enable the experimental PiD memory optimizations in invokeai.yaml, then restart InvokeAI:
pid_memory_optimization: trueThis setting applies to every supported PiD decoder. It reduces peak activation and sampler memory by processing parts of the pixel pathway in chunks and by running the sampler’s intermediates in float32 instead of float64 — measured on an RTX 4090, a 2048px decode peaks at ~1.5 GB of activations instead of ~3.7 GB. Decoding speed is roughly unchanged.
It is disabled by default because it changes the decoded image. Neither the chunked pathway nor the float32 sampler math is bit-exact with the default path, and the few-step sampler amplifies that into a small but real difference (~43 dB PSNR — visually indistinguishable, numerically not identical). A seed that reproduced an image with the setting off will not reproduce it exactly with the setting on, and because this is a server-wide invokeai.yaml option it is not recorded in image metadata — each decode logs that it ran optimized instead.
- Turn off “Scale Before Processing” on the Canvas when using PiD — PiD already decodes at 4×, so pre-scaling would inflate the work and is blocked.
- Inpaint / Outpaint are not supported with PiD yet; use text-to-image or image-to-image.
- SDXL Refiner cannot be combined with PiD — disable one of them.
- PiD’s memory use scales with the output resolution. A 2048px output needs only a little more headroom than a normal decode, but Native mode at large target sizes (e.g. a 4096px result) is significantly heavier.
- Turbo variants (e.g. Z-Image Turbo) work as usual — the low step count / no-CFG only affects generation; PiD’s own step count is separate.