PiD Sample
Where the pixel diffusion actually runs
- prepared
- sampled
Middle child of the staged trio. PiD Prepare assembled the payload, PiD Finalize will turn it into an image - and PiD Sample is the part that actually runs the NVIDIA pixel-diffusion decode. It takes a PID_PREP object in, runs the distilled denoising, and hands a PID_SAMPLES object to PiD Finalize. If you're using the staged path, this is the node where the heavy lifting (and most of the VRAM) lives.
It's deliberately thin, because almost everything was decided upstream in PiD Prepare. You get a handful of knobs, all with sensible defaults.
The inputs
prepared- thePID_PREPobject fromPiD Prepare. Nothing else feeds this input; it's the pack's own type.pid_steps- default4. The Comfy-Org PiD models are 4-step distilled, so 4 is the sweet spot. The node prints a warning if you change it, because any other step count is experimental and out of distribution - more steps doesn't linearly mean "better," it means "different, probably worse."cfg_scale- default1.0. A distilled decoder, so classifier-free guidance of 1 is correct. This is not your LDM's CFG; don't crank it.seed- for reproducible detail.aggressive_cleanup- defaulttrue; frees CUDA memory aggressively when sampling finishes so the next stage (or your next queue item) starts with a clean slate.
How it works
The node runs the native PiD sampling on the prepared batch - loading the diffusion model and Gemma text encoder paths that PiD Prepare resolved, decoding from the CPU-staged latent, and producing a pixel-space tensor. The progress is reported through a PiD progress bar, and the output is a PID_SAMPLES object rather than a raw image; that conversion is PiD Finalize's job. The staging is the whole point: your generation finished earlier, freed its VRAM, and only now does PiD's decoder load in for a focused run.
The workflow
PiD KSampler Capture -> pid_latent -> PiD Prepare -> PiD Sample -> PiD Finalize -> Save Image
You can also run the same staged path from any latent (e.g. PiD Empty Latent Image, or an img2img encode) - just feed it through PiD Prepare and into PiD Sample.
Setup and gotchas
One install for the pack: ComfyUI Manager → "ComfyUI-PiD", or git clone https://github.com/Merserk/ComfyUI-PiD.git into ComfyUI/custom_nodes, pip install -r requirements.txt, then restart. Needs recent ComfyUI (0.28.0+) and Python 3.10+.
Real-world notes:
- It's the memory spike. The decode of a
2kto4klatent to ~4096 is where OOMs happen. If you crash here, drop to2k, and double-checkaggressive_cleanupis on. - Step count ≠ quality ladder. Leave
pid_stepsat 4. The distilled checkpoints were trained for exactly this trajectory; the warning in the console isn't flavor text. - Don't wire it directly to Save Image.
PiDSampleoutputsPID_SAMPLES, notIMAGE- that's whatPiD Finalizeis for. Missing that hop is the most common wiring mistake, and it's an easy one to make on first build.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| prepared | PID_PREP | — | |
| pid_steps | INT | 41–64 | — |
| cfg_scale | FLOAT | 1.00–20 | — |
| seed | INT | 00–2147483647 | — |
| aggressive_cleanup | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| sampled | PID_SAMPLES | — |