Z-Image Turbo for WebGPU
Z-Image Turbo (Tongyi-MAI, Apache-2.0) converted for the "LoRA image studio" page of AI Showcase, where it runs in the browser on the visitor's graphics card with WebGPU shaders written for that site. The page also runs Z-Image Turbo LoRAs (ai-toolkit, Kohya) without merging them into the weights.
These files are not in a standard format: they are read by the AI Showcase engine
(src/lib/zimage/ in that repository). For diffusers, ComfyUI or other tools, use the original
model.
Files
| Files | Part | Size | Format |
|---|---|---|---|
manifest.json |
index of every tensor: shard, byte offset, shape, format; error per compressed layer | 0.2 MB | JSON |
text-q4-*.bin |
text encoder (Qwen3-4B, layers 0 to 34) | 2.38 GB | 4-bit, int8 token table |
transformer-q4-*.bin |
image transformer | 3.82 GB | 4-bit with a rank-32 fp16 correction |
transformer-q8-*.bin |
image transformer | 6.67 GB | 8-bit |
vae-00.bin |
VAE decoder (FLUX.1 autoencoder) | 0.10 GB | fp16 |
tokenizer.json, tokenizer_config.json |
Qwen3 tokenizer | 11 MB | unchanged |
The browser needs the text encoder, the VAE and one of the two transformers: 6.3 GB with 4-bit, 9.2 GB with 8-bit.
How the weights were compressed
Each large linear layer W of the image transformer is split into a low-rank part B A (rank 32,
found with a randomized SVD, stored in fp16) and the rest W - B A, stored as 4-bit codes with an
fp16 scale and minimum per group of 64 weights; the converter tries a few slightly narrower ranges
per group and keeps the one with the smallest error. The mean relative error per layer is 0.079
for the 4-bit transformer, 0.0055 for the 8-bit transformer and 0.088 for the 4-bit text encoder;
manifest.json lists the error of every layer. The text encoder keeps layers 0 to 34, because
Z-Image reads the hidden state after layer 34; the VAE keeps only its decoder.
The converter is tools/convert_zimage.py in the AI Showcase repository; the full list of changes
is in NOTICE.
Speed and quality
Checked on 2026-11-20 in Chrome on an Apple M4 Pro (24 GB): a 512 x 512 picture in 8 steps takes about 51 s with the 4-bit transformer and 47 s with the 8-bit one, using 5.9 GB and 8.8 GB of GPU memory. On the same converted weights, the browser engine's outputs match diffusers 0.43.0 and transformers 5.23.0 (cosine similarity 1.000000 for the text encoder, one transformer step and the VAE decoder). Pictures from the 4-bit and 8-bit versions differ only in small details.
License and credits
Apache License 2.0, like the original weights (see LICENSE and NOTICE).
- Z-Image Turbo: Tongyi-MAI team, Alibaba Group,
Tongyi-MAI/Z-Image-Turbo, revision
f332072aa78be7aecdf3ee76d5c247082da564a6. - Text encoder and tokenizer: Qwen3-4B, Qwen team, Alibaba Cloud, Qwen/Qwen3-4B.
- VAE: the FLUX.1 autoencoder, Black Forest Labs, whose weights are released under Apache-2.0 (black-forest-labs/flux).
The model can make pictures of real people and reflects the biases of its training data. Follow the original model's guidance and the law where you use it.
Model tree for miroleon/z-image-turbo-webgpu
Base model
Tongyi-MAI/Z-Image-Turbo