Views
No views yet
qwen-tts package:pip install -U qwen-tts1import torch
2import soundfile as sf
3from qwen_tts import Qwen3TTSModel
4
5# Load the model
6model = Qwen3TTSModel.from_pretrained(
7 "Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoice",
8 device_map="cuda:0",
9 dtype=torch.bfloat16,
10 attn_implementation="flash_attention_2",
11)
12
13# Generate speech with specific instructions
14wavs, sr = model.generate_custom_voice(
15 text="其实我真的有发现,我是一个特别善于观察别人情绪的人。",
16 language="Chinese",
17 speaker="Vivian",
18 instruct="用特别愤怒的语气说",
19)
20
21# Save the generated audio
22sf.write("output_custom_voice.wav", wavs[0], sr)Qwen3-TTS-12Hz-0.6B-CustomVoice, the following speakers are supported. We recommend using each speaker’s native language for the best results:| Speaker | Voice Description | Native Language |
|---|---|---|
| Vivian | Bright young female voice. | Chinese |
| Serena | Warm, gentle young female voice. | Chinese |
| Uncle_Fu | Seasoned male voice, mellow timbre. | Chinese |
| Dylan | Youthful Beijing male voice. | Chinese (Beijing) |
| Eric | Lively Chengdu male voice. | Chinese (Sichuan) |
| Ryan | Dynamic male voice with rhythm. | English |
| Aiden | Sunny American male voice. | English |
| Ono_Anna | Playful Japanese female voice. | Japanese |
| Sohee | Warm Korean female voice. | Korean |
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}