CoolFace
Modelpublic

benchmarkxprt/Z-Image-Turbo

sourceHugging Faceapache-2.0updated 12d agoView on Hugging Face
1likes
Model Card

Z-Image-Turbo

This repository provides an optimized ONNX version of [Tongyi-MAI/Z-Image-Turbo](https://huggingface.co/Tongyi-MAI/Z-Image-Turbo), specifically tailored for efficient browser execution via WebNN and WebGPU using ONNX Runtime Web.

๐Ÿ”„ Runtime Pipeline

The end-to-end inference flow runs sequentially across the ONNX sub-models under onnx/ per image generation:

Inference Flow

<div align="center"> <img src="https://cdn-uploads.huggingface.co/production/uploads/65ee995fc7b0ce53e4a91edb/2ckM0sTl3VVrRzJ-5recK.jpeg" style="max-width: 100%; height: auto;" alt="Z Image Turbo Pipeline"> </div>

๐Ÿงฉ Sub-model Components

StageONNX Model ArtifactPrecisionKey Role
1. Text Encodingtext_encoder_model_q4f16.onnxQ4F16Encodes text prompts into conditional embeddings
2. Denoisingtransformer_model_q4f16.onnxQ4F16Predicts noise latents across diffusion iterations
scheduler_step_model_f16.onnxFP16Computes denoised latents per step
3. Decodingvae_pre_process_model_f16.onnxFP16Scales and shifts latents for decoding
vae_decoder_model_f16.onnxFP16Reconstructs pixel-space RGB image from latents
4. Safetysc_prep_model_f16.onnxFP16Normalizes and pre-processes the image for the safety checker
safety_checker_model_f16.onnxFP16Inspects processed image features to ensure content safety

๐Ÿ› ๏ธ Export & Reproduction

Instructions and scripts for exporting and optimizing the ONNX models from the original PyTorch weights can be found in the model_exporter/README.md.

๐ŸŒ Live Demo

Experience the model running in the browser:

๐Ÿ“‘ Credits