Nodes/ComfyUI-NO8D-controls/NO8D-Empty latent
ComfyUI Node

NO8D-Empty latent

Aspect ratios without the mental math

By no8d·Created 2 months ago·Updated 14 days ago· 271
NO8D-Empty latent
    • latent
    • width
    • height
    aspect_ratio1:1
    short_side512
    invert_ratiofalse
    manual_short_side0
    manual_long_side0
    batch_size1

    Every ComfyUI workflow starts the same way: you need an empty latent, and you have to type two numbers that multiply out to the right aspect ratio. Want 9:16 at a decent size? That's 768×1365, then fix it because it isn't a multiple of 8, then re-fix it. NO8D-Empty latent is the wrapper that does that arithmetic for you - you pick an aspect ratio and a short side, and it hands you a latent plus the exact width and height it used, in case anything downstream needs the numbers.

    It's a thin node, and it's honest about being one: it delegates to ComfyUI's native EmptyLatentImage. What it adds is the ratio logic on top. The author's own description says it plainly - "choose dimensions, then create the latent with ComfyUI's native EmptyLatentImage node" - so don't expect anything magical, just fewer wrong-sized batches.

    The inputs that matter

    • aspect_ratio - seven presets: 1:1, 1:2, 2:3, 3:4, 4:5, 9:16, 9:21. Pick the shape, not the numbers.
    • short_side - how big, from 512 up to 1536. This is the shorter edge; the long edge is derived to keep the ratio exact.
    • invert_ratio - flips the selected ratio between portrait and landscape. Select 2:3 and invert, and you get 3:2. Handy when you're doing a batch of both orientations.
    • manual_short_side / manual_long_side - leave both at 0 and the node derives everything from the presets. Set one and it derives the other from the ratio; set both and you get exactly that. Both clamp to multiples of 8 for you.
    • batch_size - how many latents in the batch, default 1. For a run of variations this is how you get N images from one generation.

    Outputs are latent, width, and height. Wire the latent into your sampler's latent input. The width/height outputs are the quiet selling point - they give you the exact pixel dimensions as real values, which is what you need if you're also sizing a reference image or a mask to match.

    Where it fits

    In a plain text-to-image workflow it replaces the core Empty Latent Image node without a second thought. Where it actually shines is when you're iterating on composition: you want to flip a 9:16 to 16:9, or test the same prompt at 512, 768, and 1024 short sides. The presets make that a two-click change instead of an arithmetic session, and the invert_ratio toggle handles the portrait/landscape flip that trips people up in the core node.

    Install and gotchas

    Same pack install as every NO8D node - ComfyUI Manager, search "NO8D-controls":

    cd ComfyUI/custom_nodes
    git clone https://github.com/no8d/ComfyUI-NO8D-controls.git
    python -m pip install -r requirements.txt
    

    No models, no downloads. One thing worth knowing: the default short side is 512, which is fine for SD1.5-era checkpoints but small for modern bases - a Krea 2 or Flux family model will want 896 or 1024 on the short side. And the old-style width/height widgets from earlier releases get migrated into the new ratio controls automatically, so a saved workflow won't lose its dimensions on update. If a generation comes out smaller than you expected, check which short side is selected - that's the whole story.

    CategoryNO8D-control

    Inputs (6)

    NameTypeDefaultDescription
    aspect_ratioCOMBO1:17 options: 1:1, 1:2, 2:3, 3:4, 4:5, 9:16, +1
    short_sideCOMBO5127 options: 512, 640, 768, 896, 1024, 1280, +1
    invert_ratioBOOLEANfalseSwap the selected aspect ratio between portrait and landscape.
    manual_short_sideINT00–16384Override the short side. Keep at 0 to calculate it from the selected size or manual long side.
    manual_long_sideINT00–16384Override the long side. Keep at 0 to calculate it from the aspect ratio.
    batch_sizeINT11–4096The number of latent images in the batch.

    Outputs (3)

    NameTypeDescription
    latentLATENTThe empty latent created by ComfyUI's native EmptyLatentImage node.
    widthINTThe final pixel width passed to the core node.
    heightINTThe final pixel height passed to the core node.