Nodes/ComfyUI Empty Latent Advanced/πŸ“ Empty Latent Advanced
ComfyUI Node

πŸ“ Empty Latent Advanced

An Empty Latent node that stops you Googling 'SDXL aspect ratios'

By amenoriraΒ·Created 9 months agoΒ·Updated 9 months agoΒ· 0
πŸ“ Empty Latent Advanced
    • Latent
    • Width
    • Height
    β—„Resolutionβ–― 832Γ—1216 (SDXL - 2:3)β–Ί
    β—„ModeUse Presetβ–Ί
    β—„Ratio Locktrueβ–Ί
    β—„Width832β–Ί
    β—„Height1216β–Ί
    β—„Batch Size1β–Ί

    It's EmptyLatentImage with a better front door

    If you've built more than one ComfyUI workflow you've met the stock Empty Latent Image node - the thing that starts every txt2img graph with a blank slate of latent noise. This is that node with a dropdown instead of arithmetic. Pick a resolution off a menu of 20 presets labelled by model family, and the width/height widgets fold away so the node stays tiny on your graph.

    That's the whole pitch, and for its target audience it's a good one: you stop Googling "what are the SDXL aspect ratios" and just pick β–― 832Γ—1216 (SDXL - 2:3).

    How it actually works

    Under the hood it does exactly what the core node does - a torch.zeros([batch, 4, height//8, width//8]) tensor on CPU. The //8 is the VAE downsampling: SD1.5 and SDXL both compress 8x per side, so a 1024Γ—1024 image lives as a 128Γ—128 latent. All zeros means no signal at all, which is the point - the sampler builds the image from that blank start. That's also what the README's "Zero-Lag" claim means: it's a fresh tensor, no VAE encode step, nothing to wait on.

    The 20 presets are hardcoded and grouped: seven SD1.5 ratios around 512px, nine SDXL ratios (the official multi-aspect training set - 832Γ—1216, 1216Γ—832, 1024Γ—1024 and friends), and four HD/FHD ratios like 1080Γ—1920.

    The Mode dropdown decides how those presets get used:

    • Use Preset (default) - the dropdown picks the size; Width/Height are ignored, and the JS extension hides them so the node renders as one compact widget.
    • Override - unlocks Width and Height. Turn Ratio Lock on and changing one side recomputes the other to match the selected preset's aspect ratio.

    The inputs and outputs that matter

    • Resolution - the 20-preset enum, default β–― 832Γ—1216 (SDXL - 2:3).
    • Mode - Use Preset / Override.
    • Ratio Lock (default on) - only honored in Override mode.
    • Width / Height (64–16384, step 8), Batch Size (1–64).

    Outputs: Latent, the LATENT you feed into the KSampler, plus Width and Height as INTs - the rounded final numbers. Wire those into a crop or conditioning node and you never have to recompute the actual dimensions by hand.

    Installing

    ComfyUI Manager, search Empty Latent Advanced, install, restart. Or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ameyukisora/ComfyUI-Empty-Latent-Advanced.git
    

    Then restart ComfyUI. No requirements.txt, no model downloads, nothing but one Python file and a small JS extension - the install is genuinely painless. Find the node under right-click β†’ Add Node β†’ Latent β†’ πŸ“ Empty Latent Advanced.

    Should you bother?

    Honest take: the output is byte-identical to stock Empty Latent Image. You're paying for the menu and the auto-hide, so the value shows up if you hop between SD1.5 and SDXL workflows, or do a lot of portrait crops and are tired of typing dimensions from memory. If you never leave 1024Γ—1024, you don't need it. The preset list is fixed to those three families - Flux and other non-8x-VAE or non-SDXL models get no rows, so use Override there.

    Two small footguns, worth restating so they don't bite: Ratio Lock derives its ratio from the selected preset, not your typed numbers - switch presets and the "locked" ratio silently changes. And any width/height you type gets rounded to a multiple of 8 (min 64), with the INT outputs reporting the rounded values, so don't expect what you typed back verbatim.

    Categorylatent

    Inputs (6)

    NameTypeDefaultDescription
    ResolutionCOMBOβ–― 832Γ—1216 (SDXL - 2:3)20 options: β–― 512Γ—896 (9:16), β–― 512Γ—768 (2:3), β–― 480Γ—640 (3:4), β–‘ 512Γ—512 (1:1), β–­ 640Γ—480 (4:3), β–­ 768Γ—512 (3:2), +14
    ModeCOMBOUse Preset2 options: Use Preset, Override
    Ratio LockBOOLEANtrueβ€”
    WidthINT83264–16384β€”
    HeightINT121664–16384β€”
    Batch SizeINT11–64β€”

    Outputs (3)

    NameTypeDescription
    LatentLATENTβ€”
    WidthINTβ€”
    HeightINTβ€”