Nodes/ComfyUI-PiD/PiD Empty Latent Image
ComfyUI Node

PiD Empty Latent Image

The empty latent that already knows your backbone

By Merserk·Created 3 months ago·Updated 2 months ago· 122
PiD Empty Latent Image
    • latent
    pid_ckpt_type2k
    resolution512x512 (1:1)
    batch_size1
    backbonesd3

    Stock ComfyUI's Empty Latent Image gives you a 4-channel SD1.5-style latent. That's the wrong shape for almost everything modern - Flux wants 16 channels at 8x downscale, Flux2 wants 128 channels at 16x, and your sampler will happily error the moment it touches them. PiD Empty Latent Image is the replacement that already knows which backbone you're using, so it produces a latent with the correct channels, downscale, and size metadata before a single pixel gets generated.

    It's the quiet utility of the pack, but it's load-bearing: the whole PiD chain validates the latent against the backbone, and this node is how you get that right the first time instead of reading a "expected 16-channel latents, got 4" error.

    How it works

    You pick a pid_ckpt_type and a resolution, and the node builds a zero latent sized for that backbone's latent format. A Flux-family latent at 1024x1024, for example, comes out as [batch, 16, 128, 128] (1024 ÷ 8x downscale, 16 channels). It also stamps the latent with the downscale ratio and the pid_source_backbone marker, which downstream PiD nodes use to validate and normalize your input.

    The resolution menu has 18 presets across the two checkpoint profiles: nine 512-class shapes for 2k (512x512 through 336x784 ultrawide) and nine 1024-class shapes for 2kto4k. These are the base sizes PiD is trained to decode - remember final output is normally 4x, so 2kto4k at 1024x1024 decodes to ~4096.

    Inputs that matter

    • backbone - the model family (10 choices: zimage, zimage-turbo, flux, flux2, flux2-klein-4b/9b, sd3, sdxl, qwenimage, qwenimage-2512). This drives channels, downscale, and which checkpoint profiles are valid.
    • pid_ckpt_type - 2k or 2kto4k. Not every backbone supports both (SDXL and Qwen-Image are 2kto4k-only; in the UI the node hides incompatible choices).
    • resolution - pick from the presets for your profile.
    • batch_size - 1 to 64, default 1.

    Default backbone is sd3 and default resolution is 512x512, which is a fine starting combo for a 2k run.

    The workflow

    It sits at the front of a text-to-image PiD chain, replacing the normal Empty Latent:

    PiD Text Prompt -> CLIP Text Encode -> PiD KSampler Capture (latent_image from this node)
                                         └── pid_latent -> PiD Prepare -> PiD Sample -> PiD Finalize -> Save Image
    

    If you're skipping generation and going straight to decode, you can also feed its latent into PiD Prepare directly to see what PiD does with a blank slate.

    Setup and gotchas

    Install once for the whole pack (ComfyUI Manager → "ComfyUI-PiD", or git clone https://github.com/Merserk/ComfyUI-PiD.git into custom_nodes, pip install -r requirements.txt, restart). No models to download for this node itself - it just makes a tensor.

    Two things to keep in mind. First, the resolution you pick is the base the PiD output multiplies from: a 512x512 2k latent is heading for a ~2048 final, not 512. Second, if you're loading an old workflow that predates the backbone widget, the node defaults conservatively to 16 channels/8x - which is right for Flux-family and SD3, but wrong for Flux2 (128ch/16x) and SDXL (4ch/8x). Just set backbone explicitly and the latent will match.

    CategoryPiD

    Inputs (4)

    NameTypeDefaultDescription
    pid_ckpt_typeCOMBO2k2 options: 2k, 2kto4k
    resolutionCOMBO512x512 (1:1)18 options: 512x512 (1:1), 576x432 (4:3), 432x576 (3:4), 624x416 (3:2), 416x624 (2:3), 672x384 (16:9), +12
    batch_sizeINT11–64
    backboneCOMBOsd310 options: zimage, zimage-turbo, flux, flux2, flux2-klein-4b, flux2-klein-9b, +4

    Outputs (1)

    NameTypeDescription
    latentLATENT