Nodes/KJNodes for ComfyUI/Empty Latent Image Presets
ComfyUI Node Runs on cloud

Empty Latent Image Presets

Stop memorizing SDXL resolutions

By kijai·Created 3 years ago·Updated about 17 hours ago· 2,930
Empty Latent Image Presets
    • Latent
    • Width
    • Height
    dimensions512 x 512 (1:1)
    invertfalse
    batch_size1

    Quick, what's the SDXL portrait resolution that's closest to 3:4 without going off the rails? If you had to think about it, that's exactly why this node exists. EmptyLatentImagePresets is a drop-in replacement for the core Empty Latent Image node, except instead of two number boxes you get a dropdown of good, pre-baked resolutions. Pick "1024 x 576 (1.778:1)" and you're done. No arithmetic, no accidentally typing 1000 instead of 1024 and wondering why the composition looks off.

    It's a tiny convenience node and it's not going to change your life, but it removes a small recurring annoyance, and those add up.

    What it does

    Every txt2img workflow starts with an empty latent - a blank canvas of the right dimensions for the sampler to fill in. The size you pick matters a lot, because diffusion models were trained on specific aspect-ratio "buckets" and drift outside them at your peril (hello, duplicated heads and stretched bodies). This node just hands you a menu of the sane ones so you don't fight the model.

    The inputs

    Three, and only one you'll touch often:

    • dimensions - the dropdown. It ships with ten presets running from 512 x 512 (1:1) up through the widescreen 1536 x 640 (2.4:1) and the SDXL-friendly 1344 x 768, 1216 x 832, 1152 x 896, and 1024 x 1024. These are the standard aspect-ratio buckets, labeled with their ratio so you can pick by shape.
    • invert - flips the chosen dimensions. Every preset is written landscape/wide; toggle this to get the portrait version without needing a separate set of entries. One dropdown covers both orientations.
    • batch_size - how many latents to generate at once. Leave it at 1 unless you're batching seeds.

    Outputs are the Latent itself plus Width and Height as integers. Those two are the underrated part: wire them into a resize node, a ControlNet preprocessor, or a save-filename builder so the whole graph stays in sync with whatever preset you picked. Change the dropdown and everything downstream follows.

    Installing KJNodes

    In ComfyUI Manager, search "KJNodes for ComfyUI" in the Custom Nodes Manager, install, restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt (portable: python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-KJNodes\requirements.txt), then restart. There's nothing to download beyond the pack - this node just allocates an empty tensor.

    Worth knowing

    The presets are tuned for SD1.5 and SDXL-era resolutions. Newer models - Flux, the Wan and LTX video stacks, the latest anime and realism checkpoints - often want higher base resolutions or their own aspect buckets, and the biggest preset here tops out around 1.5 megapixels. So treat this as a great default for SDXL and a starting point for newer models, not gospel. If a model's docs give you a native resolution, use that; you can always fall back to the plain number-box latent node when you need an off-menu size.

    And that's really the only "issue" - it's a preset picker, so its limitation is simply the presets it ships with. If none of the ten fit, the core Empty Latent Image node with manual dimensions is one node away.

    CategoryKJNodes/latents

    Inputs (3)

    NameTypeDefaultDescription
    dimensionsCOMBO512 x 512 (1:1)10 options: 512 x 512 (1:1), 768 x 512 (1.5:1), 960 x 512 (1.875:1), 1024 x 512 (2:1), 1024 x 576 (1.778:1), 1536 x 640 (2.4:1), +4
    invertBOOLEANfalse
    batch_sizeINT11–4096

    Outputs (3)

    NameTypeDescription
    LatentLATENT
    WidthINT
    HeightINT