Nodes/ComfyUI-Lightning/Sana Empty Latent Image
ComfyUI Node

Sana Empty Latent Image

The canvas node, sized for Sana's VAE

By shenduldh·Created 2 years ago·Updated about a year ago· 225
Sana Empty Latent Image
    • LATENT
    width1024
    height1024
    batch_size1

    This one's exactly what it looks like: the blank canvas node that starts every Sana text-to-image workflow, the same job ComfyUI's core Empty Latent Image does for SD and Flux. It gets its own node in this pack rather than reusing the core one because Sana's VAE isn't the usual VAE - a latent shaped for an 8x-compression autoencoder isn't the right shape for Sana's 32x-compression DCAE, and using the wrong one is a quiet way to get a broken generation.

    What it is and why you'd reach for it

    Every diffusion sampler needs a starting point: a tensor of the right shape, filled with noise, that gets progressively denoised into an image. This node builds that starting tensor sized and shaped correctly for Sana's latent space. It's the first node in the chain, upstream of your sampler, and it's what determines your output resolution and how many images you generate in one batch.

    How it works

    Nothing exotic - it allocates an empty latent tensor at the dimensions you specify, scaled down internally by whatever factor Sana's DCAE VAE expects (recall the pack's Sana VAE is the f32c32 design: 32x spatial compression, 32 channels), and hands it off ready for your sampler to fill in.

    The inputs and outputs that matter

    • width / height (default 1024 each, range 32–16384, step 32) - your target output resolution. Sana's native training resolution is 1024x1024, per the README's own benchmark claim of "1024x1024 images within 2s" - treat that as your reliable starting point and expect the model to be less predictable well outside it, the same way any diffusion model degrades off its trained resolution.
    • batch_size (default 1, range 1–4096) - how many latents to generate in parallel. Given how fast Sana already runs, batching is one of the more practical ways to actually use that speed - generate a grid of options in the time a single Flux image would take, rather than only using the speed for quicker single images.

    Output is a LATENT - the node's own tooltip describes it plainly as "the empty latent image batch," and it goes straight into your KSampler alongside your Sana model and Gemma conditioning.

    How to install it

    • ComfyUI Manager - search "ComfyUI-Lightning", install, restart.
    • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/shenduldh/ComfyUI-Lightning, then restart.

    No model downloads needed for this specific node - it's pure tensor allocation, no weights involved. You'll need the rest of the Sana stack (diffusion model, DCAE VAE, Gemma text encoder, per the README) to actually run a full generation around it.

    Common issues & troubleshooting

    I used the core Empty Latent Image node instead and my Sana generation came out wrong. That's the reason this dedicated node exists - a latent shaped for a standard 8x-compression VAE doesn't match what Sana's 32x-compression DCAE expects. Always pair Sana's own loaders and this latent node together rather than mixing in core ComfyUI nodes built for SD/Flux's VAE geometry.

    Generation quality drops off noticeably at unusual aspect ratios or resolutions. Expected behavior for any diffusion model pushed outside its training distribution - Sana's benchmark numbers and demonstrated quality center on 1024x1024. If you need a different aspect ratio, start close to that pixel count and adjust width/height in the 32-pixel steps the node enforces rather than jumping to something far off it.

    Out of memory at a large batch size. batch_size goes up to 4096 in the node's own limits, which is far beyond what any consumer GPU will hold in VRAM at once - that ceiling exists for headroom, not as a realistic target. Scale batch size down until it fits, the same as you would with any other model's latent batch.

    CategoryLightning/Sana

    Inputs (3)

    NameTypeDefaultDescription
    widthINT102432–16384
    heightINT102432–16384
    batch_sizeINT11–4096

    Outputs (1)

    NameTypeDescription
    LATENTLATENTThe empty latent image batch.