Nodes/Empty Latent Image Plus/Empty Latent Image Plus
ComfyUI Node

Empty Latent Image Plus

The Empty Latent node that hands you back its own width and height

By ukr8b3g-cmyk·Created 2 months ago·Updated 2 months ago· 1
Empty Latent Image Plus
    • LATENT
    • WIDTH
    • HEIGHT
    width512
    height512
    batch_size1

    ComfyUI's built-in Empty Latent Image is one of the first nodes everyone drags in, but it has a quiet flaw: it knows your canvas size and refuses to tell you. Any time a downstream node wants the width and height as plain numbers - a canvas or framing helper, a prompt/layout node, upscaling math, a regional conditioner - you're typing those values a second time, or fishing them out of some "get image size" node further upstream. Two places holding the same number is how a workflow quietly drifts out of sync, and you don't notice until a batch comes back at the wrong aspect ratio. Empty Latent Image Plus is a drop-in replacement for the stock node that also outputs WIDTH and HEIGHT as INTs. One node, one source of truth.

    How it works

    The backend is nearly a photocopy of the core node:

    latent = torch.zeros([batch_size, 4, height // 8, width // 8])
    

    Same 8× downsample per side, same 4 latent channels - that's the VAE's compression factor (SD1.5, SDXL and Pony all sit on a 4-channel latent at 8×). The tensor this node produces is indistinguishable from the stock node's, so anything that accepted an Empty Latent Image output accepts this one. The extra behavior lives in a small frontend JS file that layers on the swap W/H toggle, the preset section, the "Advanced" fold, and a live size-info line. Nothing here calls a model, an API, or a key.

    The inputs and outputs that matter

    Only three inputs, all familiar:

    • width / height - INT, default 512, min 16, max 16384, step 8. Identical behavior to the core node.
    • batch_size - INT, default 1, min 1, max 4096. Clamped at 1 both in the UI and in the backend, so you can't accidentally create an empty batch.

    Outputs: LATENT (wire it into the sampler like always), WIDTH, and HEIGHT (wire either into anything that wants an INT resolution). That's the whole pitch - the latent and its own dimensions come from one place and can't disagree.

    The swap W/H trap

    The frontend adds a swap W/H toggle, default off. Flip it to true and the node swaps width and height - latent and outputs follow. Here's the gotcha: flip it back to false and nothing happens. It's a one-way trigger, not a state you can undo by toggling again. The README is explicit about it; set the numbers by hand if you want to un-swap. batch_size is untouched.

    Presets, and where they live

    The foldable User Preset section gives you a name field plus Save/Load/Delete buttons, with an Advanced fold holding Size Step (8/16/32/64), Clamp on Load (default true), and a Show Info toggle - the info line reads width x height | aspect ratio | megapixels. Presets are saved to presets.json in the node's own folder through little HTTP routes, so they're per-machine and per-owner: they do not travel inside a shared workflow JSON. The workflow remembers the widget values; your named presets stay home.

    Installing it

    cd ComfyUI/custom_nodes
    git clone https://github.com/ukr8b3g-cmyk/Empty-Latent-Image-Plus.git
    

    Then restart ComfyUI - or just search "Empty Latent Image Plus" in ComfyUI Manager. Good news: the pyproject.toml declares zero dependencies and there are no model files to fetch, so install is about as failure-proof as custom nodes get. It'll show up under latent/plus as "Empty Latent Image Plus".

    Where to be careful

    This is a 4-channel, 4D latent. That covers SD1.5, SDXL, Pony, and anything that eats a standard Empty Latent Image output - but Flux-class models want a 16-channel latent (that's EmptySD3LatentImage territory), so don't expect this node to feed one despite the README listing Flux among its targets. Same story for video: no temporal dimension here, so it's not a video-latent node.

    Beyond that: it's a small, brand-new pack from a little-known author with zero community chatter at time of writing. That's fine - the risk profile is tiny because there's no dependency surface - just don't expect much in the way of forum support if something odd surfaces.

    Categorylatent/plus

    Inputs (3)

    NameTypeDefaultDescription
    widthINT51216–16384
    heightINT51216–16384
    batch_sizeINT11–4096

    Outputs (3)

    NameTypeDescription
    LATENTLATENT
    WIDTHINT
    HEIGHTINT