ONNX-exported version of Qwen3-TTS for portable, framework-free speech synthesis. Supports Voice Clone (clone a voice from reference audio) and Voice Design (create a voice from a text description).
Note: This is a community ONNX conversion of the official Qwen3-TTS models. For the original PyTorch models, training details, benchmarks, and academic citations, please refer to the official Qwen3-TTS repository.
Features
Pure ONNX inference — no PyTorch dependency required at runtime
Voice Clone: clone any voice from a short (3s+) reference audio clip
Voice Design: create a voice from natural-language descriptions (e.g., "A warm, gentle young female voice")
Voice Design then Clone: design a voice via description, then save it as a reusable speaker profile
Pre-computed global cache: constant embeddings are pre-computed and shipped, reducing cold-start time
1# Using huggingface-cli2pip install -U "huggingface_hub[cli]"3huggingface-cli download <YOUR_HF_REPO_ID> --local-dir ./model
45# Or using git lfs6git lfs install7git clone https://huggingface.co/<YOUR_HF_REPO_ID> ./model
3. Three-Step Pipeline
The inference pipeline consists of three independent scripts. Steps 1 and 2 only need to be run once; Step 3 is the actual synthesis.
Step 1: Generate Global Cache (one-time)
Pre-compute constant embeddings shared across all speakers and texts. The cache files (model_cache.npz) are already included in this repository, so you can skip this step unless you re-export the models.
python generate_cache.py --model_dir ./model
Step 2: Create Speaker Profile (once per voice)
Create a reusable speaker profile from either a reference audio or a voice description.
Option A — Voice Clone (from reference audio):
bash
1python create_speaker.py \2 --model_dir ./model \3 --ref_audio reference.wav \4 --ref_text "Transcript of the reference audio"\5 --language english \6 --output ./speakers/my_voice.npz
Option B — Voice Design then Clone (from text description):
bash
1python create_speaker.py \2 --model_dir ./model \3 --instruct "A warm, gentle young female voice"\4 --design_text "Hello, this is a sample of my voice."\5 --language chinese \6 --output ./speakers/designed_voice.npz
The speaker profile (.npz) contains pre-computed speaker embeddings and codec features, making subsequent synthesis fast.
Step 3: Synthesize Speech
Using a speaker profile (Voice Clone):
bash
1python synthesize.py \2 --model_dir ./model \3 --speaker ./speakers/my_voice.npz \4 --text "The weather is wonderful today."\5 --output output.wav
Direct Voice Design (no speaker profile needed):
bash
1python synthesize.py \2 --model_dir ./model \3 --instruct "Speak in a cheerful, energetic young male voice"\4 --text "The weather is wonderful today."\5 --output output.wav
Generation Parameters
All synthesis commands support these optional parameters:
Parameter
Default
Description
--language
chinese
Language: chinese, english, japanese, korean, auto
This repository contains ONNX exports of the following Qwen3-TTS components:
Component
Description
Speaker Encoder
Extracts speaker embedding (x-vector) from reference audio
Speech Tokenizer
Encoder/decoder for audio ↔ discrete codec codes
Text Embedding
Maps text token IDs to embedding vectors
Codec Embedding
Maps codec token IDs to embedding vectors
Talker (Voice Clone)
Autoregressive transformer for voice clone synthesis
Talker (Voice Design)
Autoregressive transformer for voice design synthesis
Code Predictor
Predicts multi-codebook codes from talker hidden states
Supported Languages
Chinese, English, Japanese, Korean, German, French, Russian, Portuguese, Spanish, Italian
Requirements
Python 3.9+
onnxruntime >= 1.16 (or onnxruntime-gpu for GPU)
numpy >= 1.24
librosa >= 0.10
soundfile >= 0.12
tokenizers >= 0.15 (recommended, pure Rust, fast) or tiktoken (fallback)
Credits
This is an ONNX conversion of Qwen3-TTS by the Qwen team at Alibaba. All credit for the model architecture, training, and research goes to the original authors.
Citation
If you use this model, please cite the original paper:
bibtex
1@article{Qwen3-TTS,
2 title={Qwen3-TTS Technical Report},
3 author={Hangrui Hu and Xinfa Zhu and Ting He and Dake Guo and Bin Zhang and Xiong Wang and Zhifang Guo and Ziyue Jiang and Hongkun Hao and Zishan Guo and Xinyu Zhang and Pei Zhang and Baosong Yang and Jin Xu and Jingren Zhou and Junyang Lin},
4 journal={arXiv preprint arXiv:2601.15621},
5 year={2026}
6}