Nodes/ComfyUI_FunCode/Empty Latent FunCode
ComfyUI Node

Empty Latent FunCode

Seventy-one resolutions, zero guessing

By kaiery·Created 8 months ago·Updated about a month ago· 0
Empty Latent FunCode
    • latent
    • width
    • height
    resolution
    batch_size1
    width_override1024
    height_override1024
    invertfalse

    Empty Latent FunCode is the empty latent you already know - a blank LATENT you feed a sampler - plus a dropdown with 71 resolution presets so you stop typing sizes and guessing what your model actually likes. Every model family has native-ish resolutions it was trained on, and getting those right is one of those silent quality wins nobody thanks you for. This node does that part for you.

    Reach for it anywhere you'd reach for core ComfyUI's Empty Latent Image: img2img where you want a specific canvas size, hi-res fix stages that operate on fixed dimensions, or video workflows that need a set frame size. The reason to pick this over the core node is the preset menu, full stop.

    What's in the dropdown

    The presets are grouped by the model they're tuned for, and the label tells you the aspect ratio:

    • H3 - a long 16:9 ladder (608×352 up to 1920×1088), the video-frame family.
    • FHD / QHD / 4K - portrait lists (1080×1920, 1440×2560, 2160×3840) for phone-style output.
    • Flux - 1024×1024, 768×1344, 832×1216 and friends; the classic Flux-Dev native set.
    • Qwen - Qwen-Image's square and portrait sizes (1328×1328 and the rest).
    • ZIT - Z-Image Turbo's native resolutions, including the tall 9:21 list (864×2016, 720×1680).
    • SDXL - the full 1024-era family, 1:1 through 1:2.
    • Wan - video-frame sizes like 544×960 and 720×1280.
    • SD15 - 512/768 legacy sizes for the SD 1.5 holdouts.

    Inputs and outputs

    The ones you'll actually touch:

    • resolution - pick a preset, or custom to use the override fields.
    • batch_size (default 1, up to 64) - how many empty latents to make at once.
    • width_override / height_override - only used when resolution is custom.
    • invert - flips width and height, which is your "give me the landscape version of this portrait preset" switch.

    Outputs are three: latent (the thing you wire to the sampler), plus width and height as plain integers - handy for feeding the same dimensions to a resize or an image-size-aware node elsewhere in the graph, so everything downstream agrees on the canvas.

    How it works

    The node allocates a batch of zero tensors shaped (batch, 4, height/8, width/8) on your active device - the /8 is the VAE's downscale factor baked in, which is why 1024 in becomes 128 in the latent space. It's genuinely empty: no noise, no conditioning. The sampler fills it.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/kaiery/ComfyUI_FunCode
    

    Restart ComfyUI and it shows up under FunCode/Image. No model downloads, no pip requirements - this node is pure torch.

    Gotchas

    • The presets are recommendations, not guarantees - they match the sizes each family is commonly trained on, but your checkpoint may do fine a step off. When in doubt, the label's aspect ratio matters more than the exact pixel count.
    • Don't forget invert exists. It's the fastest way to go from the portrait preset you grabbed to the landscape frame you actually wanted, without touching custom.
    • The width/height outputs are the part people sleep on. One preset pick, and every downstream node that needs the dimensions can read them from the wire instead of hardcoding.

    It's a utility node, so there's no drama here - but if you've ever eyeballed "is 832×1216 right for this?" at 2 a.m., this dropdown is the whole point.

    CategoryFunCode/Image

    Inputs (5)

    NameTypeDefaultDescription
    resolutionCOMBO71 options: custom, H3 - 608×352 - [16:9], H3 - 736×416 - [16:9], H3 - 864×480 - [16:9], H3 - 960×544 - [16:9], H3 - 1056×608 - [16:9], +65
    batch_sizeINT11–64
    width_overrideINT102464–4096
    height_overrideINT102464–4096
    invertBOOLEANfalse

    Outputs (3)

    NameTypeDescription
    latentLATENT
    widthINT
    heightINT