ComfyUI Node

Z-Image Generate

One node, the whole Z-Image Base model — no API, no keys, just VRAM

By suravaya113·Created 3 months ago·Updated 3 months ago· 0
Z-Image Generate
    • image
    promptA cinematic portrait photo, soft natural light, detailed skin texture
    model_idTongyi-MAI/Z-Image
    width1024
    height1024
    steps25
    guidance_scale4.5
    seed0
    dtypeauto
    clear_cachefalse
    negative_prompt

    Z-Image without the graph

    If you just want a Z-Image picture and can't be bothered to wire up the native ComfyUI Z-Image loader, sampler, VAE and text encoder, this node is the shortcut. It's one box on the canvas: type a prompt, pick a resolution, hit go. Behind the curtain it loads Alibaba's Z-Image Base (Tongyi-MAI/Z-Image) through Hugging Face Diffusers, runs the whole pipeline internally, and hands you a plain IMAGE tensor you can preview or save like any other.

    The catch is in the name: this is a wrapper around the whole model, not a native ComfyUI implementation. You trade fine-grained control for "it just works." For a quick idea, that's often the right trade. For anything serious you'll outgrow it fast - it has no sampler selection, no LoRA loading, no ControlNet, no upscaling.

    What you're actually running

    Default model_id is Tongyi-MAI/Z-Image - that's the Base model, the non-distilled 6.15B checkpoint Alibaba shipped in January 2026, not the faster Turbo. The difference matters. Base wants CFG 3–5 and 25–50 steps; Turbo is guidance-distilled, wants CFG 1 and 8–9 steps. The node's defaults (25 steps, guidance 4.5) are right in the Base sweet spot, which suggests the author actually tuned them for Base. If you switch model_id to Tongyi-MAI/Z-Image-Turbo, keep those defaults and you'll get burned, overcooked images. Also worth knowing: because the text encoder is Qwen3-4B, Chinese prompts land noticeably better than English ones.

    Mechanically the node is simple and readable: DiffusionPipeline.from_pretrained(model_id, dtype=...), then one pipe(...) call inside torch.inference_mode(). The pipeline is cached in a module-level dict keyed on (model_id, device, dtype), so the second generation doesn't re-load the model. There's no ComfyUI-native Z-Image quirks here - which is a genuine upside, because it also means the infamous Sage Attention corruption on Base never applies; diffusers doesn't use ComfyUI's attention patches.

    The inputs that matter

    Most of the nine fields are self-explanatory. The ones to actually touch:

    • prompt - natural language, not tags. Z-Image is a prose model.
    • width / height - 256 to 2048, step 64. Stay in the 1–2MP native range (1024² or 1216×832); past ~2MP quality degrades.
    • steps / guidance_scale - 25/4.5 defaults are fine for Base. Add steps if a prompt fights you.
    • negative_prompt - optional, and it works on Base (it's meaningless on Turbo).
    • clear_cache - leave off for repeated generations; flip it on if you want VRAM back after one shot.

    The output is a single IMAGE, wired straight into a PreviewImage or SaveImage node. That's it - one image per run, no batch.

    Install

    The README's own clone command has a placeholder in it, so copy with your eyes open:

    cd ComfyUI/custom_nodes
    git clone https://github.com/suravaya113/SKIT_ComfyUI-ZImage-Generate
    pip install -r SKIT_ComfyUI-ZImage-Generate/requirements.txt
    

    Then restart ComfyUI. Or just search "SKIT_ComfyUI-ZImage-Generate" in ComfyUI Manager. Two real gotchas: the requirements pin diffusers straight from GitHub main (diffusers @ git+https://github.com/huggingface/diffusers.git) plus transformers==4.57.3, so it can clobber your existing diffusers install - make sure ComfyUI's native Z-Image support still works after. And the first run downloads the whole Base model (plus the 4B Qwen text encoder) from Hugging Face. That's many gigabytes and a long load; a 12GB card will run it, and it'll use ~3–4 minutes per image there.

    Troubleshooting

    • "ZImageGenerate requires diffusers and related packages" - exactly what it says: you skipped the pip step. Install requirements and restart.
    • Slow first generation - it's downloading the model, not hung. Run once, let it finish, and subsequent gens are fast from cache.
    • Expecting Turbo, getting slow Base - check model_id. Turbo needs its own settings.
    • VRAM pressure with clear_cache on - it unloads after every generation, so the next one re-loads and re-downloads nothing but re-loads from disk. Fine for one-off, wasteful for iteration.

    Honest verdict: this is the fastest way to get from zero to a Z-Image picture in ComfyUI, and the defaults are sane. If you stay on Base and one-box simplicity, it'll treat you fine. The moment you want LoRAs, samplers, or speed, graduate to the native nodes - but keep this around for a quick sanity check.

    CategoryZ-Image

    Inputs (10)

    NameTypeDefaultDescription
    promptSTRINGA cinematic portrait photo, soft natural light, detailed skin texture
    model_idSTRINGTongyi-MAI/Z-Image
    widthINT1024256–2048
    heightINT1024256–2048
    stepsINT251–100
    guidance_scaleFLOAT4.50–20
    seedINT00–18446744073709550000
    dtypeCOMBOauto4 options: auto, bfloat16, float16, float32
    clear_cacheBOOLEANfalse
    negative_promptoptSTRING

    Outputs (1)

    NameTypeDescription
    imageIMAGE