SuperAPI AI Directory

ZipVoice

ZipVoice is a series of zero-shot text-to-speech (TTS) models based on flow matching, focused on fast, high-quality voice cloning. The core model has only 123M parameters, supports both Chinese and English, and provides two modes: single-speaker speech generation and conversational speech generation. The model achieves state-of-the-art performance in speaker similarity, clarity, and naturalness. The project has also released ZipVoice-Dialog, ZipVoice-Dialog-Stereo conversational generation models, and the OpenDialog dataset. Users can obtain the code through the GitHub repository, and after installing dependencies and the k2 library, they can perform inference or training, with support for various acceleration solutions such as CPU multithreading, ONNX, and GPU TensorRT.

Open website

About this tool

ZipVoice is a series of zero-shot text-to-speech (TTS) models based on flow matching, developed by the k2-fsa team. It is designed to achieve fast and high-quality voice cloning.

Main Capabilities

  • Small and fast: the model has only 123M parameters.
  • High-quality voice cloning: state-of-the-art performance in speaker similarity, clarity, and naturalness.
  • Multilingual: supports Chinese and English.
  • Multi-mode: supports single-speaker speech generation and conversational speech generation.

Model Variants

  • 2025/07/14: Released ZipVoice-Dialog and ZipVoice-Dialog-Stereo, two spoken dialogue generation models.
  • 2025/07/14: Released the OpenDialog dataset, a 6.8k-hour spoken dialogue dataset.
  • 2025/06/16: Released ZipVoice and ZipVoice-Distill.

Usage

  1. Clone the ZipVoice repository.
  2. (Optional) Create a Python virtual environment.
  3. Install the required packages.
  4. Install k2 (for training or efficient inference). k2 is required for training and can accelerate inference, but k2 does not need to be installed for inference mode. You need to install the k2 version matching your PyTorch and CUDA versions. After checking the installation, you can perform the following operations:

Single-Speaker Speech Generation

Use the pretrained ZipVoice or ZipVoice-Distill model to generate single-speaker speech. --model-name can be zipvoice or zipvoice_distill. In the text, content within <> is Chinese pinyin, and content within [] is other special tags. Each line of test.tsv has the format {wav_name}\t{prompt_transcription}\t{prompt_wav}\t{text}.

Conversational Speech Generation

Use the pretrained ZipVoice-Dialogue or ZipVoice-Dialogue-Stereo model to generate two-party dialogue. --model-name can be zipvoice_dialog or zipvoice_dialog_stereo, generating mono and stereo dialogue respectively. test.tsv supports both the merged prompt format and the separate prompt format.

Usage Recommendations

  • It is recommended to use shorterPrompt audio (less than 3 seconds for single-speaker speech, less than 10 seconds for dialogue speech) to speed up inference and avoid audio quality degradation.
  • If inference speed is unsatisfactory, the following acceleration measures can be taken:
    • Distilled model and fewer steps: The single-speaker model uses zipvoice by default for better audio quality. If speed is prioritized, you can switch to zipvoice_distill and reduce --num-steps to as low as 4 (default 8).
    • CPU multithreading: When running on CPU, pass the --num-thread parameter (e.g., --num-thread 4) to increase the number of threads; the default is 1 thread.
    • CPU ONNX acceleration: Use the ONNX model on CPU (zipvoice.bin.infer_zipvoice_onnx). You can further set --onnx-int8 True to use the INT8 quantized model, but quantization will cause some audio quality degradation. Do not use ONNX on GPU, as it is slower than PyTorch.
    • GPU NVIDIA TensorRT acceleration: First use zipvoice.bin.tensorrt_export to export the TensorRT engine, then use zipvoice.bin.infer_zipvoice for inference. The throughput is about 2 times that of the standard PyTorch implementation.
  • Text is chunked and batched by punctuation (single-speaker) or speaker turn markers (dialogue), and can handle arbitrarily long text with almost constant memory usage. Memory can be controlled via --max-duration.
  • Input is preprocessed by default to improve efficiency. If you want to evaluate raw performance, pass --raw-evaluation True.
  • Extremely short text generation may miss sounds; you can pass --speed 0.3 to extend the duration.
  • pypinyin is used to convert Chinese pinyin, which may misread polyphonic characters. You can manually correct pinyin and mark tones using angle brackets <>, such as 这把剑<chang2>三十公分. Multiple pinyin can be wrapped separately with <>.
  • The model automatically determines the position and length of silence. Occasionally there may be long silence in the middle, which can be removed by passing --remove-long-sil (edge silence is removed by default).
  • When downloading pretrained models and connecting to HuggingFace is difficult, you can switch to a mirror site: export HF_ENDPOINT=https://hf-mirror.com。

Training and Deployment

  • Training your own model: See the training, fine-tuning, and evaluation examples in the egs directory.
  • Production deployment: The NVIDIA Triton GPU runtime provides high-performance and scalable deployment, including optimized TensorRT engines, concurrent request handling, and gRPC/HTTP APIs. For CPU deployment, refer to the C++ solution of sherpa-onnx.

Communication

You can discuss in GitHub Issues, or scan the QR code to join the WeChat group and follow the WeChat official account.

Limitations

Detailed information about specific pricing, platform restrictions, or other unmentioned features of the model is not currently provided.