ZImageLatent
Stop guessing Z-Image resolutions — use the official dropdown
- Latent
- Width
- Height
Z-Image is one of those models where the actual generating is the easy part - it's fast, runs on modest VRAM, and looks great. The fiddly part is remembering which resolutions it actually likes. Alibaba's official Z-Image-Turbo Space ships with a fixed dropdown of supported sizes, and if you've been typing guesses into EmptyLatentImage - 1216x832 here, 1600x1056 there - you're reinventing a list that already exists. ZImageLatent just hands you that official dropdown as a node. That's the whole job, and it does it cleanly.
What it actually is
A utility node that outputs an empty latent at any of the 33 resolutions Alibaba's official app.py supports, plus the width and height as plain integers. It's EmptyLatentImage restyled for the Z-Image generation stack. There's no model loading, no VAE, no API call, no key - despite the pack name, nothing "AI" happens in here. The whole thing is a torch.zeros() call behind a nice dropdown.
For context on why this exists: Z-Image's native sweet spot is roughly 1–2 megapixels, and going past ~2MP natively is where quality starts to fall apart (the KB's Z-Image guide is full of people discovering this the slow way). The official resolution list is your guardrail against that. It's also worth knowing where this fits in the wider stack - Z-Image pairs with a ModelSamplingAuraFlow shift of ~7 and, on the fast path, its own distilled sampler settings, so treat this node as the "which dimensions" piece of a bigger workflow, not the workflow.
How it works
It's a 30-line node. You pick a resolution label like 1248x832 ( 3:2 ), it splits off the dimensions, and builds a zeroed latent tensor of shape [batch, 4, height // 8, width // 8] - the standard 8x-downsampled, 4-channel latent format ComfyUI's Z-Image path expects. It also rounds width and height down to multiples of 16 as a safety net. Every preset in the list is already a multiple of 16, so in practice that rounding never fires; it's just future-proofing.
The resolutions are grouped into three base buckets - 1024, 1280, and 1536 - each with the same 11 aspect ratios: 1:1, 9:7, 4:3, 3:2, 16:9, 21:9, plus every portrait mirror. The 1536 bucket tops out around 2MP, which matches the model's documented native ceiling. One light caveat: the list is copied from the official Space as of late 2025, so it's a snapshot, not a living spec - but it's the best curated set of "resolutions that won't embarrass you" you'll find.
The inputs and outputs that matter
Only two inputs, and honestly only one of them needs your attention:
- resolution - the dropdown with 33 choices. Pick one and go.
- batch_size - default 1, up to 64. Generating multiple at once is the standard Z-Image speed trick, but each latent is a real allocation, so don't max it out on a 6GB card and wonder why it choked.
Three outputs:
- Latent (LATENT) - the empty latent. Wire it into your sampler (a plain KSampler or the community ZSampler Turbo).
- Width / Height (INT) - the pixel dimensions of the chosen resolution. Handy if something downstream - a conditioning-size matcher, an upscaler target, or just a debug display - wants real pixel numbers.
Installing it
Trivial, because there's nothing to install beyond the node itself. No requirements.txt, no model downloads, no heavy deps - it's pure PyTorch against the ComfyUI API. Through ComfyUI Manager, search "ComfyUI-ZImageLatent" and hit install, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/HellerCommaA/ComfyUI-ZImageLatent
Then restart ComfyUI. It's MIT-licensed, and a single-dev personal project - expect a small, quiet, stable utility, not an actively maintained pack.
Common issues & troubleshooting
There aren't many failure modes, because the node is nearly logic-free. The ones people do hit:
- Expecting it to load the model. It won't, and it isn't supposed to. You still need the Z-Image checkpoint, the Qwen3-4B text encoder, and the VAE loaded separately. This node only answers the "which resolution" question.
- Using it with a non-Z-Image model. The 1024 bucket is harmless on SDXL, but the 1536 bucket pushes past what most other models natively like. It's tuned for Z-Image; for anything else, the stock
EmptyLatentImageis the right tool. - Missing from the node menu after install. Restart ComfyUI fully - this is the classic "installed but didn't restart" moment. If it still won't show, check that the folder landed in
custom_nodesasComfyUI-ZImageLatent.
That's the whole list, which is the nicest thing you can say about a utility node: it does one small thing, and gets out of your way.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| resolution | COMBO | 33 options: 1024x1024 ( 1:1 ), 1152x896 ( 9:7 ), 896x1152 ( 7:9 ), 1152x864 ( 4:3 ), 864x1152 ( 3:4 ), 1248x832 ( 3:2 ), +27 | |
| batch_size | INT | 11–64 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| Latent | LATENT | — |
| Width | INT | — |
| Height | INT | — |