Nodes/Light-x02 Nodes/🧱 Universal Latent Settings
ComfyUI Node

🧱 Universal Latent Settings

One dropdown, three model families, a correctly-sized latent every time

By Light-x02·Created 11 months ago·Updated 9 months ago· 11
🧱 Universal Latent Settings
    • LATENT
    • width
    • height
    model_resolutionZ-image (1024)
    resolution1024x1024 ( 1:1 )
    flip_orientationfalse
    batch_size1
    width_override0
    height_override0

    This is the current, maintained replacement for the pack's (OLD) Latent Settings node - the one that adds Z-Image to the resolution lists and fixes the workflow-switching bugs. It's a "give me an empty latent at the right size" node, and what makes it nicer than stock ComfyUI's Empty Latent is the UI: pick a model family from model_resolution and the resolution dropdown instantly rebuilds itself with that family's curated list. No two parallel lists, no toggle you'll forget to flip.

    The model families

    The model_resolution choices are FLUX, SDXL, and three Z-Image tiers (1024 / 1280 / 1536). Flux gets its 26 aspect-ratio-labeled presets, SDXL gets its classic list, and the Z-Image sets are tuned to that model's typical working sizes. If you're not on Z-Image yet - it's the small, fast 6B family that took the community by storm in late 2025 - you can still pick its resolutions and use them for anything; the sizes are just sensible defaults for modern widescreen and portrait crops.

    What you set, what you get

    • model_resolution - FLUX / SDXL / Z-image (1024) / Z-image (1280) / Z-image (1536). Drives which resolution list shows.
    • resolution - the filtered list; labels like 1536x1536 (1.0) or 1280x720 ( 16:9 ).
    • flip_orientation - swap width/height.
    • batch_size - how many blank latents to build.
    • width_override / height_override - manual override that beats the preset (0 = off, stepped to multiples of 8).

    Outputs: LATENT, plus width and height as plain integers - the last two are the sleeper feature, letting you wire the resolved size into other nodes or metadata strings without parsing text.

    The one caveat that matters

    Like its predecessor, this node always builds a 4-channel latent ([batch, 4, h/8, w/8], 8× downsampled). That's correct for SDXL and its whole finetune family. But Flux and Z-Image run on a 16-channel VAE - so for those models, this LATENT won't directly feed a sampler. Use it for SDXL directly, or for Flux/Z-Image treat it as a size reference: read the width/height outputs into ComfyUI's EmptySD3LatentImage. The resolution lists are model-aware; the latent channels are not, and that distinction trips people up.

    A small reliability note from the changelog: a December 2025 fix ensures the selected resolution is always applied after switching workflows - previously the node could silently fall back to 1536×1536 after you loaded a different workflow. That one's fixed, so don't let an old tutorial scare you off.

    Install

    Ships in Light-x02 Nodes - ComfyUI Manager → search "ComfyUI-Lightx02-Nodes", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Light-x02/ComfyUI-Lightx02-Nodes
    

    Restart ComfyUI, look under 💡Lightx02/latent. The dynamic dropdown is handled by the pack's JS, so if the resolution list ever stops updating when you switch model families, refresh your browser / clear the cache rather than reinstalling. No model downloads, no extra Python deps.

    Category💡Lightx02/latent

    Inputs (6)

    NameTypeDefaultDescription
    model_resolutionCOMBOZ-image (1024)5 options: FLUX, SDXL, Z-image (1024), Z-image (1280), Z-image (1536)
    resolutionCOMBO1024x1024 ( 1:1 )85 options: 1056x2112 (0.5), 1056x2016 (0.52), 1152x2016 (0.57), 1152x1920 (0.6), 1248x1824 (0.68), 1248x1728 (0.72), +79
    flip_orientationBOOLEANfalse
    batch_sizeINT11–4096
    width_overrideINT00–16384
    height_overrideINT00–16384

    Outputs (3)

    NameTypeDescription
    LATENTLATENT
    widthINT
    heightINT