Nodes/ComfyUI-Universal-Latent/🌌✨ Universal Latent (Enhanced) 🎨⚑
ComfyUI Node

🌌✨ Universal Latent (Enhanced) 🎨⚑

The empty latent node that actually remembers your model's channels

By theshubzworldΒ·Created 9 months agoΒ·Updated 9 months agoΒ· 1
🌌✨ Universal Latent (Enhanced) 🎨⚑
    • LATENT
    • width
    • height
    β—„resolution1024x1024 (1:1)β–Ί
    β—„batch_size1β–Ί
    β—„width_override0β–Ί
    β—„height_override0β–Ί
    β—„aspect_ratio_lockUnlockedβ–Ί
    β—„latent_channels4β–Ί
    β—„downsample_factorautoβ–Ί
    β—„invert_ratiosNoβ–Ί

    Every txt2img workflow starts in the same dull place: a gray Empty Latent Image node asking you to type a width and height you'll have forgotten by next week. Universal Latent (Enhanced) is that node with the boring parts removed and the footguns addressed. Same job - hand the sampler a blank latent to denoise - but it bundles 72 resolution presets and, crucially, a latent_channels setting, so the same node works for SDXL and Flux instead of making you remember whether to grab EmptyLatentImage (4 channels) or EmptySD3LatentImage (16).

    Let me be honest about scale before you get hooked: this is a tiny pack from an author with almost no community footprint, and the node has essentially zero Reddit signal. That's not a red flag - it's a pure-torch utility, no dependencies, no model downloads, no API, no keys. The name promises "universal"; what it really means is "one node for both SD-family and Flux empty latents, with aspect ratios built in."

    How it works

    Mechanically it's about as simple as ComfyUI nodes get. You pick a string like 1024x1024 (1:1), and the node splits it into width and height, applies any overrides, optionally swaps the axes, clamps the result to 64–16384, then divides by a downsample factor to get the latent dimensions. SDXL and Flux VAEs both compress 8x per side, so auto (8) is correct for both; the manual 4 option is the escape hatch for the handful of VAEs that compress 4x. The output is a zeros tensor of shape [batch, channels, latent_h, latent_w] on the intermediate device - that all-zeros tensor is literally the empty canvas the sampler starts from.

    The inputs that matter

    • resolution - the whole point. 72 presets across 1:1, 2:3, 3:2, 1:2, 2:1, 4:7 mobile/story, 16:9 widescreen, plus a custom-ratio bucket (5:12, 13:19, 7:9…). Pick, don't type.
    • latent_channels - the trap. Defaults to 4, which is right for SD/SDXL. Switch it to 16 for Flux or the sampler will die on a shape mismatch.
    • batch_size - how many empty latents to make in one pass. The max is 4096; you will never set it anywhere near that.
    • width/height override + aspect_ratio_lock + invert_ratios - for when a preset isn't quite right. Lock "Width" or "Height" and the other dimension scales to keep the ratio; invert flips portrait↔landscape in one click.

    Three outputs: LATENT (wire it into the sampler's latent input), plus width and height INTs. Those last two are sneaky-useful - they report the actual pixel size the latent represents after the Γ·8 rounding, which is subtly different from what you typed whenever your number isn't divisible by 8. Feed them to any downstream node that needs the true size.

    Install

    ComfyUI Manager β†’ search "Universal Latent", or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/theshubzworld/ComfyUI-Universal-Latent.git
    

    Then restart ComfyUI. That's it - no requirements.txt, no models to fetch, so nothing to troubleshoot on setup. It's also published to the Comfy Registry, so Manager treats it as a registry pack.

    Where people get burned

    The channel count is the big one - forgetting 16 for Flux produces a hard shape error, and the error message doesn't always tell you why. Second: leave downsample_factor on auto. Set it to 4 against an 8x VAE and your decoded image comes back half the size you asked for, with an aspect ratio you didn't intend. And yes, the display name is 🌌✨ Universal Latent (Enhanced) 🎨⚑; double-click the node title if that offends your graph's aesthetic.

    It's a nicer Empty Latent Image, not a replacement for anything smarter. On SDXL with no Flux in sight, the more famous answer is comfyui_essentials' SDXL Empty Latent Size Picker - this one wins when you hop between SD and Flux models and want one node to cover both.

    Categorylatent

    Inputs (8)

    NameTypeDefaultDescription
    resolutionCOMBO1024x1024 (1:1)72 options: 512x512 (1:1), 576x576 (1:1), 640x640 (1:1), 704x704 (1:1), 768x768 (1:1), 832x832 (1:1), +66
    batch_sizeINT11–4096β€”
    width_overrideINT00–16384β€”
    height_overrideINT00–16384β€”
    aspect_ratio_lockCOMBOUnlocked3 options: Unlocked, Width, Height
    latent_channelsINT41–16β€”
    downsample_factorCOMBOauto3 options: auto, 4, 8
    invert_ratiosCOMBONo2 options: No, Yes

    Outputs (3)

    NameTypeDescription
    LATENTLATENTβ€”
    widthINTβ€”
    heightINTβ€”