Nodes/ComfyUI/Empty Latent Image
ComfyUI Node Runs on cloud

Empty Latent Image

The blank canvas every txt2img graph starts with

By Comfy-Org·Created 4 years ago·Updated about an hour ago· 129,962
Empty Latent Image
    • LATENT
    width512
    height512
    batch_size1

    If you've opened a single ComfyUI workflow, you've seen this node - usually floating top-left, feeding the KSampler, and you've probably never touched it because it just works. Empty Latent Image is the starting point for text-to-image: a blank latent of zeros that the sampler fills with your prompt's image. It's not a blank picture - it's the compressed canvas the diffusion model paints on, and it's the reason txt2img works at all.

    Three inputs:

    • width / height - default 512×512, step 8. Pixel dimensions of the final image; the latent it creates is 8× smaller per side (a 512 image becomes a 64×64 latent).
    • batch_size - default 1, up to 4096. How many independent images to generate in one run. Each is its own noise field, so batch 4 = four different pictures.

    Output: a LATENT - a tensor of zeros with the downscale_ratio_spacial: 8 marker and, critically, 4 channels. Four channels is the SD 1.5/SDXL contract: the tiny compressed representation of an image's structure that the UNet learns to denoise into something viewable.

    Why it's a zero, not noise

    New users sometimes expect an "empty" latent to be random noise. It isn't - it's all zeros. The sampler handles the noise: it builds the noisy starting tensor from your seed and denoises from it. Zero is just "I don't have any image to preserve." That's the whole difference from img2img, where you'd VAE Encode a real image instead. Same downstream graph, different starting point.

    Where it fits

    The canonical txt2img chain: Empty Latent Image → KSampler (with your positive/negative conditioning and seed) → VAE Decode → Save Image. It's also the backbone of hi-res fix (an empty latent upscaled with Latent Upscale, re-sampled at low denoise), latent upscaling workflows, and anything that wants to start from nothing.

    The gotchas

    • Native resolution is a real thing. 512×512 is SD 1.5's home turf; SDXL wants 1024×1024; the newer DiT models want their own numbers. Generate an SDXL image at 512 and you get a mess - the model was trained at 1024. The node will happily make a 512 canvas; it won't warn you it's the wrong size for your checkpoint. This is the single most common beginner failure and it has nothing to do with the node.
    • Width/height step of 8. The latent is the image divided by 8, so the numbers must be multiples of 8 (hence the step). Set 513 and Comfy rounds or errors. For SD3/Flux-family models the step is 16 and they use their own node (EmptySD3LatentImage).
    • Channel adaptation is handled, so don't panic if you see it. Feed this 4-channel latent to a 16-channel model (Flux, SD3) and the sampler's fix_empty_latent_channels pads it up automatically - that's why Flux workflows sometimes reuse this node. It works, but the dedicated node is cleaner.

    It's the most boring node in ComfyUI and the most important. Understand what those zeros are - a compressed 4-channel canvas the sampler fills - and half the confusion about latents, channels, and resolution falls away.

    Categorymodel/latent

    Inputs (3)

    NameTypeDefaultDescription
    widthINT51216–16384The width of the latent images in pixels.
    heightINT51216–16384The height of the latent images in pixels.
    batch_sizeINT11–4096The number of latent images in the batch.

    Outputs (1)

    NameTypeDescription
    LATENTLATENTThe empty latent image batch.