deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

PiD decodes low-resolution latents straight to 4K without a separate upscaling pass

A dev.to post by AI-KSK shows PiD decoding small latents directly to 4K in one pass across FLUX, Z-Image and SD3.5, with paired outputs for judging it against each model's native decode.

PiD decodes low-resolution latents straight to 4K without a separate upscaling pass

A set of ComfyUI workflows published on dev.to by AI-KSK demonstrates PiD, a decoding technique that produces 4K images directly from low-resolution latents in a single pass, replacing the conventional route of generating a small image and enlarging it afterward.

One decode at target size

The technique shifts where high resolution comes from. In a typical pipeline, the diffusion model renders at a modest size and a separate upscaler adds pixels by inferring detail from a finished image. According to the dev.to write-up, PiD performs the decode itself at the target resolution, so the additional detail is synthesized from the latent the model produced rather than reconstructed from compressed pixels. Base generation stays small and cheap; the resolution work moves into the decoder.

A five-node pipeline

PiD arrives as five ComfyUI nodes. PiDPrepare selects the model family, such as flux or zimage, and the resolution lane; this family selector is what lets one node group serve different checkpoints, since each family has its own latent convention. PiDTextPrompt feeds the prompt into the decode path. PiDKSamplerCapture records the base sampler's state, including seed, step count, scheduler and CFG, so it can be replayed at the target resolution. PiDSample runs the multi-block decode and PiDFinalize emits the finished image.

The author singles out PiDSample's block scheduling strategy, with sequential_blocks_aggressive as the published example, as the main quality-versus-speed trade-off and the first parameter to experiment with.

Base latents stay small

The workflows reinforce a structural point: generation never happens at 4K. The FLUX.1, SD3.5 and Z-Image graphs all start from a 1024×1024 latent, the FLUX.2 graph uses a 576×1024 portrait latent, and the Z-Image workflow's own notes recommend a 512×512 base for its best-quality 2K mode. The output is large because the decode is large.

Four per-model configurations

Each base model gets its own graph. The FLUX.1 Dev workflow loads an fp8 checkpoint, applies FluxGuidance at 3.5, and runs 28 steps with euler and simple scheduling at CFG 1.0. Its notes explain that Flux Dev has no negative prompt, so raising CFG damages the output rather than reinforcing the prompt.

Z-Image Turbo uses nine steps with euler and beta scheduling, plus a tiled VAE decode at 512/64/64/8, because its full-frame decode exceeds a single memory allocation. Its loader setup pairs the UNet with a Qwen 3 4B text encoder, a dedicated VAE and AuraFlow sampling set to 3.

FLUX.2 Dev needs its own VAE and its own text encoder, Mistral 3 Small rather than CLIP, which is why it gets a separate 19-node graph. The SD3.5 Large graph is the smallest of the set at 13 nodes.

Paired outputs and failure modes

Every workflow saves two images from the same latent and seed: one labeled enhanced, produced by the PiD decode, and one labeled native, produced by the model's own decode at the target resolution. The author presents these pairs as the real test of whether PiD justifies its extra nodes.

The troubleshooting notes are candid about limits. A family setting in PiDPrepare that does not match the loaded checkpoint will still run and produce something, which the author considers worse than an outright failure. Z-Image memory errors are addressed through the tiled decode rather than a smaller latent. Muddy results point at the block strategy. And PiD does not repair composition: a flawed latent decoded at 4K yields a large flawed image, which is why the post stresses that decoding straight to 4K is a claim about resolution, not about quality.

Availability

The workflows are published on RunningHub, with ComfyUI exports in a Hugging Face repository and a video walkthrough, in Chinese, on YouTube and Bilibili. The release contains workflow files only, with no model weights, and is described as an independent tutorial export that is not affiliated with or endorsed by Black Forest Labs, Stability AI, Tongyi or RunningHub.

Why it matters

Upscaling is a fixed cost in most image-generation pipelines, and PiD reframes it as a decode-time parameter. That changes the compute profile, keeping the generation pass inexpensive while the decoder absorbs the resolution work, and it collapses a workflow decision about which upscaler to use into a single tunable knob. For teams building on FLUX, Z-Image or SD3.5, the paired enhanced and native outputs make it possible to evaluate the technique against each model's own high-resolution decode under matched seeds before committing to it.

  • #image-generation
  • #comfyui
  • #diffusion-models
  • #upscaling
  • #flux