Nodes/ComfyUI-A5Nodes/A5Universal_latent_presets
ComfyUI Node

A5Universal_latent_presets

The empty latent, with the model-specific parts hidden

By A5Projects·Created 3 days ago·Updated 3 days ago· 1
A5Universal_latent_presets
    • latent
    • width
    • height
    latent_typeFlux 2
    preset1MP | 1:1 | 1024 x 1024
    width0
    height0
    invertfalse
    batch_size1

    An "empty latent" is not one thing. The channel count, the spatial downscale, and in one case whether there's a latent space at all - those are model properties, and getting them wrong gives you noise, a flat image, or a picture twice the size you asked for.

    This node hides all of that behind one dropdown of 18 resolution presets, and it exists because the author got tired of a similar Flux.2-only node that produced the wrong output size.

    The three latent types

    Flux 2 - allocates 128-channel zeros at height/16 × width/16. Flux 2's VAE is a new latent space trained from scratch, more aggressively compressed per side and much wider per unit of latent than its predecessors. The 16× factor is the part people get wrong.

    SD3 / Flux.1 / Qwen / Chroma - 16 channels at /8, which is the standard 16-channel latent those families share. This branch also tags the latent dict with downscale_ratio_spacial: 8, so downstream nodes know how the numbers map back to pixels.

    HiDream-O1 - three channels at full height × width. No VAE, no compression, raw pixel space. It's not a latent at all, which is why the model's ComfyUI workflows ship without a VAE loader and why people keep reporting those graphs as broken.

    If you know the two failure modes, you know why one dropdown matters: build a /8 latent and decode it at 16× and your image comes out double size; build a 4-channel latent for a 16-channel model and you get noise rather than a slightly odd picture.

    Presets and overrides

    Eighteen presets: six aspect ratios (1:1, 16:9, 21:9, 3:2, 4:3, 5:4) across 1MP, 2MP and 4MP. The 1MP set is the familiar 1024×1024 / 1344×768 / 1536×640 crowd; 4MP goes up to 3072×1312 for ultrawide.

    • width and height above 0 override the preset; 0 means "use the preset".
    • invert swaps width and height, which is how you get portrait versions of every landscape preset without a second list.
    • batch_size gives you multiple identical latents in one batch.

    Outputs are latent, plus width and height as integers - wire those into whatever else needs to know the canvas, instead of retyping them.

    Which preset for which model

    Match the budget to the checkpoint, not to your monitor:

    • 1MP - SDXL-era geometry, Flux.1, most Qwen and Chroma workflows. The safe default.
    • 2MP - Flux 2 Klein comfortably, Z-Image at its ceiling. Go past roughly 2MP on Z-Image and artifacts show up; the fix is a multi-pass upscale, not a bigger latent.
    • 4MP - Flux 2 Dev is built for this, if your card can stand it. Also where HiDream-O1 lives, since it's baked to 2048×2048 and will not do 1024 for you.
    • 21:9 / 16:9 - for the cinematic looks, and because a preset's dimensions are already multiples your VAE is happy with.

    The important thing to internalise: bumping resolution to "get more detail" past a model's native band usually buys you composition problems and duplicated limbs instead. Generate in the band, then upscale.

    Installing it

    cd ComfyUI/custom_nodes
    git clone https://github.com/A5Projects/ComfyUI-A5Nodes
    

    Restart ComfyUI and refresh the browser, or install A5 Custom Nodes from ComfyUI Manager. The README is specific about taking the numbered version rather than Nightly here. No Python dependencies and no model files - this node only builds a tensor full of zeros on ComfyUI's intermediate device. Disable any standalone copies of the old nodes, since IDs are preserved deliberately and duplicates will collide.

    Where people get burned

    The wrong latent type for the checkpoint. If your output looks like static, check this dropdown before you check your sampler. The three options look interchangeable and are not.

    HiDream-O1 surprises. No VAE loader in the workflow, memory usage that scales with pixel count instead of latent size, and a hard preference for 2048. If you picked the HiDream branch and got a 1MP canvas, expect noise or excessive runtime - the model's native resolution isn't a suggestion.

    Overrides bypass the preset silently. Set a width of 1536 and you get the preset's ratio at 1536 wide, whether or not that's a size the model likes.

    It's not a universal latent node. There's no 4-channel branch, so nothing here covers SD 1.5 or SDXL, and there's no video latent type. It's three specific families, done correctly, which is more than most workflows need.

    CategoryFlux 2/Latents

    Inputs (6)

    NameTypeDefaultDescription
    latent_typeCOMBOFlux 23 options: Flux 2, SD3 / Flux.1 / Qwen / Chroma, HiDream-O1
    presetCOMBO1MP | 1:1 | 1024 x 102418 options: 1MP | 1:1 | 1024 x 1024, 1MP | 16:9 | 1344 x 768, 1MP | 21:9 | 1536 x 640, 1MP | 3:2 | 1216 x 832, 1MP | 4:3 | 1152 x 864, 1MP | 5:4 | 1120 x 896, +12
    widthINT00–16384
    heightINT00–16384
    invertBOOLEANfalse
    batch_sizeINT11–4096

    Outputs (3)

    NameTypeDescription
    latentLATENT
    widthINT
    heightINT