Z-Image Turbo, bfloat16 transformer

This repository is a copy of Tongyi-MAI/Z-Image-Turbo at commit f332072aa78be7aecdf3ee76d5c247082da564a6, with the transformer's weights stored as bfloat16 instead of float32. The transformer is 12.3 GB instead of 24.6 GB, which halves its download on a rented GPU. It was made for TTS Studio, an app that turns a story into an audiobook and illustrates each scene.

What changed

Part Change
transformer/ Each float32 tensor is cast with torch.Tensor.to(torch.bfloat16). The config is unchanged.
vae/, scheduler/, tokenizer/, model_index.json Unchanged.
text_encoder/ Not included.

The cast is the same one diffusers makes when the original is loaded with torch_dtype=torch.bfloat16. With diffusers 0.41.0, all 521 weights (6.15 B parameters) of this transformer are identical, bit for bit, to the original's loaded that way. So with bfloat16 inference, this copy draws exactly what the original draws.

Usage

The text encoder is not in this repository. Load it from the original repository:

import torch
from diffusers import ZImagePipeline
from transformers import Qwen3Model

text_encoder = Qwen3Model.from_pretrained(
    "Tongyi-MAI/Z-Image-Turbo", subfolder="text_encoder",
    revision="f332072aa78be7aecdf3ee76d5c247082da564a6", dtype=torch.bfloat16)
pipe = ZImagePipeline.from_pretrained(
    "diengv/Z-Image-Turbo-bf16", text_encoder=text_encoder, torch_dtype=torch.bfloat16).to("cuda")
image = pipe("a white Asian elephant by a dry stream", num_inference_steps=9, guidance_scale=0.0).images[0]

For the model card, the recommended settings, the citation and the terms, see the original repository.

License and attribution

Z-Image Turbo is the work of its authors at Tongyi Lab and is released under the Apache License 2.0. This copy is distributed under the same license; its text is in LICENSE. The only modification is the data type of the transformer's weights, as described above.

Downloads last month
-
Safetensors
Model size
6B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for diengv/Z-Image-Turbo-bf16

Finetuned
(173)
this model