Nodes/ComfyUI Image Saver/Empty Latent (Image Saver)
ComfyUI Node Runs on cloud

Empty Latent (Image Saver)

Pick a canvas by aspect ratio and size tier

By alexopus·Created 3 years ago·Updated 29 days ago· 191
Empty Latent (Image Saver)
    • latent
    • width
    • height
    aspect_ratio1:1
    orientationlandscape
    sizeS (1024)
    batch_size1
    width_override0
    height_override0

    A friendlier empty-latent node. Instead of typing raw width and height like the stock Empty Latent Image wants, you pick an aspect ratio, an orientation, and a size tier, and it works out the actual pixel dimensions for you. It's a small quality-of-life thing, but if you generate at a bunch of different framings, it beats doing 832×1216 arithmetic in your head every time.

    It ships in the Image Saver pack as a utility, but it's completely standalone - nothing about it requires the metadata or pipe stuff. You can drop it into any workflow as your starting canvas.

    How it works

    You give it three things and it maps them to a resolution. Pick 16:9 landscape at the S (1024) tier and it hands you the latent at the right dimensions plus the width and height as numbers you can reuse. The size tiers are named by their base edge - XXS (512), XS (768), S (1024), M (1280), L (1536) - so you're really choosing "how big" and "what shape" separately, which is a nicer mental model than a single resolution box. Orientation just flips the ratio: 4:3 landscape versus 4:3 portrait swaps which dimension is longer.

    The inputs and outputs

    The ones you'll set:

    • aspect_ratio - 1:1, 9:7, 4:3, 3:2, 16:9, or 21:9. The shape of the frame.
    • orientation - landscape or portrait. Flips the ratio.
    • size - the tier: XXS (512) through L (1536). Bigger tier, bigger canvas.

    Then the practical extras: batch_size (default 1) for how many latents to generate at once, and width_override / height_override (default 0, meaning "off") for when you want to bypass the ratio-and-tier system and just force an exact dimension. Set an override to something non-zero and it wins over the calculated value.

    Three outputs:

    • latent (LATENT) - wire into your KSampler.
    • width and height (INT) - the resolved pixel dimensions, so you can feed the exact numbers into a metadata config, an upscaler, or anything else that needs to know how big the canvas is.

    Those width/height outputs are the reason to prefer this over the stock node in an Image Saver workflow - you get the dimensions as values you can route straight into Make Image Saver Metadata Config so your saved metadata matches the real resolution without retyping.

    How to install it

    ComfyUI Manager: search "ComfyUI Image Saver", install, restart.

    Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alexopus/ComfyUI-Image-Saver
    cd ComfyUI-Image-Saver
    pip install -r requirements.txt
    

    then restart. No downloads.

    Common issues & troubleshooting

    Odd or unexpected dimensions. The tier-and-ratio math produces values snapped to multiples of 8 (the step the width/height fields use), which diffusion models need. If a number looks slightly off from a "clean" resolution, that's the rounding to a valid latent size, not an error.

    Your override isn't doing anything. width_override and height_override default to 0, which means "ignore me and use the ratio/tier." They only take effect when set to a non-zero value. If you set one but not the other, only the one you set gets forced.

    Wrong resolution for your model. This node doesn't know what model you're on. SDXL and its finetunes want roughly a megapixel of total area (so the S (1024) tier and up), SD 1.5 is happier around 512–768, and each newer architecture has its own sweet spot. Pick the tier that matches your checkpoint's native resolution - a tier that's too small or too large will hurt quality regardless of the aspect ratio.

    CategoryImageSaver/utils

    Inputs (6)

    NameTypeDefaultDescription
    aspect_ratioCOMBO1:1Aspect ratio of the latent
    orientationCOMBOlandscapeLandscape keeps width ≥ height; portrait swaps them. Ignored for 1:1.
    sizeCOMBOS (1024)Resolution tier based on 1:1 base size
    batch_sizeINT11–4096Number of latents in the batch
    width_overrideINT00–16384Override width in pixels; ignored when 0
    height_overrideINT00–16384Override height in pixels; ignored when 0

    Outputs (3)

    NameTypeDescription
    latentLATENTEmpty latent tensor
    widthINTWidth in pixels
    heightINTHeight in pixels