Nodes/WtlNodes/Empty Latent (Advanced)
ComfyUI Node

Empty Latent (Advanced)

An Empty Latent node that finally tells you the dimensions

By Scorpiosis0·Created 10 months ago·Updated 2 months ago· 3
Empty Latent (Advanced)
    • Latent
    • Latent Width
    • Latent Height
    • Width
    • Height
    use_ratiofalse
    orientationfalse
    width1024
    height1024
    ratio
    resolution
    batch_size1
    latent_compression8

    Every workflow that starts from scratch needs an empty latent, and ComfyUI's built-in one is fine - right up until you need a specific aspect ratio, a non-standard VAE compression, or the actual pixel dimensions as numbers for the next node. Empty Latent (Advanced) from WtlNodes is that version. It's not a fundamental rework; it's the "I got tired of doing this math by hand" upgrade.

    The core idea is the same: you give it pixel dimensions, it gives you a LATENT at width/8 × height/8 (for the standard 8× VAE compression). The improvements are presets, sanity, and outputs.

    The inputs that matter

    • use_ratio - flip this on and instead of typing pixels you pick a ratio (1:1, 3:2, 4:3, 5:3, 16:9, 16:10, 21:9, 32:9) plus an orientation (landscape/portrait toggle). Nice for keeping generations consistent across a batch.
    • resolution - a dropdown of 28 common training-style resolutions (1024×1024, 1344×896, 1792×1344, 1920×1280…). The fastest way to land on a tried-and-true size without remembering SDXL's native set.
    • width / height - manual control, 64 to 8192, step 64. 64-step snapping is deliberate: latents want multiples of 8, and aligned sizes behave better in samplers.
    • batch_size - 1 to 256.
    • latent_compression - this is the hidden gem, default 8. It's the spatial downscale factor from pixels to latent. SD1.5 and SDXL are 8; some newer architectures differ. If your VAE compresses 16× (or 4×), set it here and the node does the division correctly instead of you eyeballing latent sizes.

    The outputs that make it useful

    Beyond the Latent itself you get four integer outputs: Latent Width, Latent Height (the latent-space dimensions), and Width, Height (pixel dimensions). Wire those into a Primitive-style math node or a Text template and you can label batches, size conditioning crops, or drive an upscale-by-multiplier pipeline with numbers that came from the source of truth - no converting by hand and no hardcoded values that break when you change resolution.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/Scorpiosis0/ComfyUI-WtlNodes.git
    

    Restart ComfyUI, or search "WtlNodes" in ComfyUI Manager. No models, no heavy deps.

    Gotchas

    • The latent_compression default is 8, and changing it doesn't resize your latent. It changes how the node computes latent dimensions from pixels. If you set it to 16 on an 8× model, you'll get a latent that's half the expected size and a confusing sampler error downstream.
    • The resolution preset list is pixel-side, not latent-side. It's a convenience picker for humans; the node still does the compression math for you.
    • Ratio + orientation gives you aspect, not absolute size. You'll still set a width (or resolution) to define the scale. The ratio then derives the other side.
    CategoryWtlNodes/latent

    Inputs (8)

    NameTypeDefaultDescription
    use_ratioBOOLEANfalse
    orientationBOOLEANfalse
    widthINT102464–8192
    heightINT102464–8192
    ratioCOMBO8 options: 1:1, 3:2, 4:3, 5:3, 16:9, 16:10, +2
    resolutionCOMBO28 options: 1152x768, 1024x1024, 1792x1344, 1344x896, 2048x1280, 1280x768, +22
    batch_sizeINT11–256
    latent_compressionINT81–64Spatial compression factor. SD/SDXL = 8, adjust for other architectures.

    Outputs (5)

    NameTypeDescription
    LatentLATENT
    Latent WidthINT
    Latent HeightINT
    WidthINT
    HeightINT