Nodes/MachinePainting Nodes/πŸ‘Ύ Z-Image Empty Latent Image
ComfyUI Node

πŸ‘Ύ Z-Image Empty Latent Image

Z-Image's preferred resolutions, one dropdown β€” no more latent size roulette

By machinepaintingΒ·Created 10 months agoΒ·Updated 4 months agoΒ· 9
πŸ‘Ύ Z-Image Empty Latent Image
    • LATENT
    • WIDTH
    • HEIGHT
    β—„dimensions1024 x 1024 (square)β–Ί
    β—„batch_size1β–Ί

    Z-Image has a quirk that catches everyone who comes from SDXL: it's picky about resolution. The model (Alibaba's Tongyi Lab family, and since late 2025 the community's local photorealism default - Z-Image Turbo runs on a 3060) was trained on a specific set of aspect ratios, and feeding it a latent at an off-preset size costs you quality in ways that aren't always obvious. πŸ‘Ύ Z-Image Empty Latent Image exists so you never have to remember the list: 17 pre-configured resolutions from 512Γ—512 up to 2048Γ—2048, covering landscape, portrait, and square - one dropdown, and you're on a preset the model actually likes.

    How it works

    The node replaces the core Empty Latent Image with a dimensions dropdown of the 17 Z-Image-optimized presets, and a batch_size input (1–64, default 1). Pick "1024 x 1024 (square)" or "1344 x 896 (landscape 3:2)" - the curated set covers the standard training buckets - and the node builds the empty latent tensor at exactly those dimensions.

    Where it beats the stock node: it outputs three things. LATENT (the empty latent for your KSampler), plus WIDTH and HEIGHT as INTs. Those extra outputs are the sleeper feature - wire WIDTH/HEIGHT into an image-size matcher, an upscaler, or a resolution-aware workflow so everything downstream agrees on the canvas without you hard-coding numbers in two places.

    Why the presets matter

    The KB's domain-overview essay is direct about Z-Image's position: it displaced Flux Dev as the local photorealism default because of hardware accessibility and speed, and it's building SDXL-style ecosystem gravity. But model quality only shows up if you feed it the shapes it was trained on - off-ratio latents get squashed or stretched, and the fix is knowing the right buckets. The three common landscape buckets (1344Γ—896, 1216Γ—832, 1152Γ—768) are all 3:2 because that's where Z-Image's training concentrates; the portrait set mirrors it. If you've been getting subtly off compositions or weird crops on Z-Image, an off-preset size is a real suspect, and this node removes that variable entirely.

    When you'd reach for it

    Anytime you're generating on Z-Image or a Z-Image fine-tune and you want to stop thinking about dimensions. It's the empty-latent node you reach for at the start of a Z-Image txt2img or img2img graph - feed its LATENT into the sampler, and if the workflow needs the size downstream (for a tiled upscale, a crop, or a size-aware node), WIDTH and HEIGHT are already there.

    Installing it

    Ships in the MachinePainting Nodes pack. ComfyUI Manager β†’ search "MachinePaintingNodes", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/machinepainting/ComfyUI-MachinePaintingNodes.git
    

    Restart ComfyUI. No heavy deps for this node - the pack's opencv-python-headless/numpy<3/rembg requirements are for its image-editing nodes, not the latent builder.

    Gotchas

    • Presets are for Z-Image, not universal. These are tuned buckets for that model family. On SDXL or Flux you generally want the model's own preferred sizes, so don't assume the preset list transfers - it's named correctly, it does what it says.
    • WIDTH/HEIGHT are the pixel dimensions, not latent dimensions. If you wire them into something expecting latent-space coordinates, you'll be off by the VAE downscale factor (usually 8). Wire them into pixel-space consumers.
    • Big presets (2048Γ—1024) eat VRAM. The dropdown won't stop you from picking a size your card can't handle - batch_size and total resolution are still on you.

    For Z-Image work, this is the boring, correct way to start a generation. Pick the bucket, get the latent, and the resolution roulette is over.

    CategoryMachinePaintingNodes/Util

    Inputs (2)

    NameTypeDefaultDescription
    dimensionsCOMBO1024 x 1024 (square)17 options: 2048 x 1024 (landscape 2:1), 1920 x 1080 (landscape 16:9), 1536 x 1024 (landscape 3:2), 1344 x 896 (landscape 3:2), 1280 x 720 (landscape 16:9), 1216 x 832 (landscape 3:2), +11
    batch_sizeINT11–64β€”

    Outputs (3)

    NameTypeDescription
    LATENTLATENTβ€”
    WIDTHINTβ€”
    HEIGHTINTβ€”