PiD Prepare
The staging node that loads PiD's heavy models once
- latent
- prepared
PiD Prepare is the first of the three staged nodes, and its job is boring in the best way: it validates your latent, moves it out of VRAM, downloads the PiD diffusion model and Gemma text encoder if they're missing, figures out the effective sigma, and bundles everything into one PID_PREP object. Then PiD Sample runs the actual decode. Splitting the work like this is what lets low-VRAM setups survive - by the time the heavy PiD model loads, your latent is sitting safely on CPU.
It's also the node that makes PiD self-explanatory when you feed it a capture: if the latent carries a pid_sigma from PiD KSampler Capture, it uses that automatically, so you don't have to remember to forward a number.
How it works
The prepare step resolves the full spec for your version/backbone/pid_ckpt_type/model_precision combination, validates that the latent's channel count matches the backbone (16 for Flux-family, 128 for Flux2, 4 for SDXL), moves the latent to CPU, computes the base image size and the final inferred size, and - if cleanup_after_prepare is on - aggressively frees CUDA memory so PiD Sample has room to load the decoder. The PID_PREP it returns is an internal pack type; you don't poke at it, you just pass it to PiD Sample.
Inputs that matter
latent- wirepid_latentfromPiD KSampler Capture, or any latent you want PiD to decode (including fromPiD Empty Latent Image).backbone- must match the latent's family, or you'll get a channel-count error. Ten choices.pid_ckpt_type-2k(512-class) or2kto4k(1024-class). This decides the base size PiD decodes from and therefore the final resolution.scale-0or4are the recommended values (4 is the native checkpoint scale for the released checkpoints).sigma- fallback sigma used only if the latent doesn't carry one; leave at0and let a capturedpid_sigmawin.caption- the text conditioning for the decode. WirePiD Text PromptorPiD Caption Creatorhere.auto_download- on by default; downloads the diffusion model and text encoder intoComfyUI/models/diffusion_models/nvidia_pid/andtext_encoders/nvidia_pid/on first run.
model_precision (default bf16, the quality pick; fp8/int8 only where supported) and version (v1/v1.5) round out the required set.
The staged workflow
PiD KSampler Capture -> pid_latent -> PiD Prepare -> PiD Sample -> PiD Finalize -> Save Image
The staged path exists precisely so you can stop, look at the memory log between stages, and not have the whole generation and the whole decode fighting for the same VRAM at once.
Setup and gotchas
Same pack install as the rest: ComfyUI Manager → "ComfyUI-PiD", or git clone https://github.com/Merserk/ComfyUI-PiD.git into ComfyUI/custom_nodes, pip install -r requirements.txt, restart. Requires a recent ComfyUI with native PixelDiT support (0.28.0+) and Python 3.10+.
Where people get tripped up:
- Mismatched latent. This is the most common error - feeding an SD1.5/SDXL-shaped latent with
backbone=fluxor similar. The node tells you exactly what it expected ("Flux PiD expects 16-channel latents, got 4 channels"), so the fix is always "encode with the right VAE or usePiD Empty Latent Image." - First run is slow. PiD Prepare downloads potentially gigabytes of model files if
auto_downloadis on and the folder is empty. That's a one-time cost, not a hang. - Unsupported combos error on purpose. e.g.
fp8with a backbone that doesn't ship it - the selectors in the UI usually prune these, but old workflows hit the backend check. Switch tobf16and move on.
Inputs (10)
| 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 |
| scale | INT | 00–8 | — |
| sigma | FLOAT | 0.0000–1000 | — |
| auto_download | BOOLEAN | true | — |
| model_precision | COMBO | bf16 | 3 options: bf16, fp8, int8 |
| cleanup_after_prepare | BOOLEAN | true | — |
| caption | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prepared | PID_PREP | — |