Nodes/ComfyUI-QwenImageWanBridge/Z-Image Empty Latent
ComfyUI Node

Z-Image Empty Latent

16-channel empty latents sized right for Z-Image

By fblissjr·Created 12 months ago·Updated 4 months ago· 188
Z-Image Empty Latent
    • latent
    • width
    • height
    • resolution_info
    width1024
    height1024
    batch_size1

    Small node, does one boring-but-necessary thing: it hands your sampler a blank latent canvas that's shaped correctly for Z-Image. The stock "Empty Latent Image" node makes a 4-channel SD-style latent. Z-Image works in a 16-channel latent space and wants its dimensions aligned to 16 pixels, so ZImageEmptyLatent builds that instead and quietly snaps your resolution to a valid size.

    If you've ever fed the wrong latent shape into a modern model and gotten a channel-mismatch error or a garbled mess, this is the node that saves you from doing that with Z-Image. It's not glamorous. It's the kind of thing you wire once and forget.

    How it works

    You give it a width, a height, and a batch size; it allocates a 16-channel latent tensor of the right size and zeroes it out - the "empty" that a text-to-image sampler starts denoising from. The alignment part is the useful bit: Z-Image needs dimensions that are multiples of 16, and this node rounds for you. The pack's own note gives the example: ask for 1211×1024 and it aligns up to 1216×1024. No more eyeballing whether your custom resolution divides cleanly.

    Worth knowing where to point it: Z-Image is happiest between 1MP and ~2MP. 1024×1024, 1216×832, and 1600×1088 are all well-trodden. Push much past 2MP natively and you'll start seeing artifacts - that's a model limit, not a latent-node limit, but this is where you set the size, so it's where it matters.

    The inputs and outputs that matter

    • width and height (default 1024×1024) - your target resolution. Type whatever you want; the node aligns it to 16px.
    • batch_size (default 1) - how many latents to generate at once.

    Outputs: latent goes straight into your KSampler's latent input. It also passes back the width and height it actually used (after alignment - handy to reuse downstream so everything agrees on the real size), and a resolution_info string describing what it did, including any snap it applied.

    How to install it

    ComfyUI Manager: search ComfyUI-QwenImageWanBridge, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fblissjr/ComfyUI-QwenImageWanBridge
    

    then restart. No model download for this node specifically - it just builds a tensor. You obviously still need a Z-Image checkpoint loaded elsewhere in the graph.

    Common issues & troubleshooting

    Your output isn't the resolution you typed. By design - check the resolution_info output or the passed-through width/height. If you asked for something not divisible by 16, it aligned up. Feed the returned dimensions to any downstream node that needs to match.

    Channel mismatch errors from the sampler. That usually means you used the stock Empty Latent Image (4-channel) instead of this one. Z-Image needs the 16-channel latent this node produces; swap it in.

    Artifacts at high resolution. Not this node's fault - you're past Z-Image's native ceiling (~2MP). Generate at 1-2MP here and upscale in a second pass rather than asking for 4MP up front.

    CategoryZImage/Latent

    Inputs (3)

    NameTypeDefaultDescription
    widthINT102416–8192Width in pixels (auto-aligned to 16px)
    heightINT102416–8192Height in pixels (auto-aligned to 16px)
    batch_sizeINT11–4096Number of latents to generate

    Outputs (4)

    NameTypeDescription
    latentLATENT
    widthINT
    heightINT
    resolution_infoSTRING