Z-Image, converted to int8 for web-xpu-ops

A converted copy of Tongyi-MAI/Z-Image, Apache-2.0, for the WebGPU demo in web-xpu-ops.

Converting a model does not relicense it. These files are Apache-2.0 and this repository is not their origin. The converter and the runtime that reads them are MIT; that MIT licence covers the code and no file here.

What is here, and what is deliberately not

file what size
dit.manifest.json, dit.q8.bin, dit.q8scales.bin, dit.f32.bin the diffusion transformer, per-row absmax int8 6.17 GB
manifest.json, decoder.bin the VAE decoder, repacked flat 0.20 GB
config.json, model.safetensors.index.json, model-0000{1,2,3}-of-00003.safetensors the Qwen3-4B text encoder, unmodified 8.04 GB

14.4 GB in total, and everything is here. The text encoder is a byte-for-byte copy of the one in Tongyi-MAI/Z-Image โ€” it was left there in a first version, on the argument that copying it duplicated what its own publisher already served. That argument is sound and the trade is not: two hosts is two things that can move, and a demo that fills a folder from one place is one thing to explain. Apache-2.0 permits the copy; the copy is what is here.

Only 6.4 GB of this is anything the conversion produced. If you want the model itself rather than a lossy conversion of part of it, take it from upstream.

What was changed

Required to be stated, and stated precisely:

  • the transformer's weights quantized from bf16 to per-row absmax int8, range [-127, 127], four codes per 32-bit word, least-significant byte first, with one f32 scale per output row applied after the dot product;
  • 248 of its 521 tensors left dense in dit.f32.bin โ€” norms, biases, the patch embedder โ€” because quantizing a [3840] norm weight buys nothing and costs resolution;
  • the VAE decoder repacked into this runtime's flat layout, values unchanged;
  • the text encoder not changed at all โ€” its five files are byte-for-byte what Tongyi-MAI/Z-Image publishes.

Nothing was retrained or fine-tuned. The transformer's 12.31 GB of bf16 becomes 6.17 GB.

The conversion is lossy and its cost is measured, not assumed. Per-weight, against the unquantized block: adaLN_modulation.0.weight is the worst at 4.78% relative RMS on layers.0's output, attention.to_q 1.21%, the rest below that โ€” which is why a mixed format exists that keeps adaLN at q8 while taking everything else to q4. This repository is the straight q8 conversion; the numbers above are in examples/zimage/README.md.

Using it

The demo binds a folder, downloads into it once, and reads from it offline afterwards โ€” see examples/zimage-web. Nothing else reads this layout; for any other purpose take the model from Tongyi-MAI/Z-Image and get f32 weights rather than a lossy conversion.

This is not an official product of Alibaba's Tongyi lab and has not been endorsed, approved or validated by them.

Downloads last month
9
Safetensors
Model size
4B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for m96-chan/Z-Image-q8-web-xpu-ops

Finetuned
(70)
this model