Skip to content

Install ZipVoice TTS with Conda

Introduction

ZipVoice is a series of fast and high-quality zero-shot TTS models based on flow matching.

GitHub: https://github.com/k2-fsa/ZipVoice
ONNX: https://github.com/thewh1teagle/zipvoice-onnx
Hugging Face: https://hf.co/k2-fsa/ZipVoice
Demo: https://zipvoice.github.io
Paper: https://arxiv.org/abs/2506.13053
Audio Samples: https://zipvoice.github.io

Prerequisites

System requirements:

  • Operating System: Windows 10/11 (64-bit), macOS, or Linux (Debian/Ubuntu).
  • Python: version >= 3.10 required
  • Disk Space: 10GB+ recommended (for dependencies and model cache). At least 400 MB for Miniconda; 3 GB+ for full Anaconda.
  • The GPU is optional but HIGHLY Recommended for Performance
  • Internet: For downloading dependencies and models from Hugging Face Hub.
Requirements CPU RAM
Minimum Intel Core i3 or AMD Ryzen 3 8 GB
Recommended Intel Core i5 or AMD Ryzen 5 16 GB
High-performance Intel Core i7/i9 or AMD Ryzen 7/9 32 GB
Environment Run this Command Architecture
CPU only pip3 install torch torchvision IA-32 and Intel 64
Apple Silicon pip3 install torch torchvision
AMD ROCm Install PyTorch for ROCm
CUDA 11.8 pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 Kepler/Maxwell → Ada Lovelace, Hopper
CUDA 12.1 pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 Kepler/Maxwell → Ada Lovelace, Hopper
CUDA 12.4 pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 Kepler/Maxwell → Ada Lovelace, Hopper
CUDA 12.6 pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126 Maxwell → Hopper
CUDA 12.8 pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128 Volta → Blackwell
CUDA 12.9 pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu129 Volta → Blackwell
CUDA 13.0 pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130 Turing → Blackwell
CUDA 13.2 pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu132 Turing → Blackwell
CUDA 13.4 pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu134 Turing → Blackwell

PyTorch Available versions:

pip index versions torch
pip index versions torchaudio
pip index versions torchvision
pip index versions torch --index-url https://download.pytorch.org/whl/cu118
pip index versions torchaudio --index-url https://download.pytorch.org/whl/cu118
pip index versions torchvision --index-url https://download.pytorch.org/whl/cu118
Environment 2.15.0 2.14.1 2.14.0 2.13.0 2.12.1 2.12.0 2.11.0 2.10.0 2.9.1 2.9.0 2.8.0 2.7.1 2.7.0 2.6.0 2.5.1 2.5.0 2.4.1 2.4.0 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.2 2.1.1 2.1.0 2.0.1 2.0.0 1.13.1 1.13.0 1.12.1 1.12.0 1.11.0
cpu ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
cu118 ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
cu121 ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
cu124 ✅ ✅ ✅ ✅ ✅
cu126 ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
cu128 ✅ ✅ ✅ ✅ ✅ ✅ ✅
cu129 ✅ ✅
cu130 ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
cu132 ✅ ✅ ✅ ✅ ✅ ✅
cu134 ✅

Video tutorial

Step 1. Install Miniconda Package

Step 2. Create Conda Environment

Create a conda environment:

name: zipvoice
channels:
- conda-forge
- defaults
dependencies:
# Python version
- python=3.11

# Install FFmpeg for torchaudio library
- ffmpeg

- pip
- pip:
    # PyTorch CPU only
    - torch
    - torchaudio
    - torchcodec

    # Core dependencies
    - numpy
    - lhotse
    - huggingface_hub
    - safetensors
    - urllib3
    - tensorboard
    - vocos
    - pydub

    # Normalization
    - cn2an
    - inflect

    # Tokenization
    - jieba
    - pypinyin

    # piper_phonemize wheel cho Windows
    - --find-links https://k2-fsa.github.io/icefall/piper_phonemize.html
    - piper_phonemize

    # Pin setuptools to avoid build errors with older packages
    - "setuptools<81"

Activate conda environment:

conda env create -f environment.yml
conda activate zipvoice

Clone and install ZipVoice from source (run after activating the environment)

git clone https://github.com/k2-fsa/ZipVoice.git
cd ZipVoice

Download the reference audio

curl -L -O "http://cva4.com/audio/prompt_english_female1.wav"

Reference audio sample voice: prompt_english_female1.wav

Can be safely ignored if you only work with WAV audio files, as Pydub supports reading and writing WAV files natively without FFmpeg. However, FFmpeg is required for processing other audio formats such as MP3, OGG, and FLAC, as well as for audio format conversion.

Step 3. Run the Inference

Inference of a single sentence

python -m zipvoice.bin.infer_zipvoice --model-name zipvoice --prompt-wav prompt_english_female1.wav --prompt-text "In order to win, you must expect to win." --text "I am the text to be synthesized." --res-wav-path result.wav

The result will be the audio file result.wav

Install k2 for training or efficient inference

k2 is necessary for training and can speed up inference. Nevertheless, you can still use the inference mode of ZipVoice without installing k2.

Note: Make sure to install the k2 version that matches your PyTorch and CUDA version. For example, if you are using pytorch 2.5.1 and CUDA 12.1, you can install k2 as follows:

pip install k2==1.24.4.dev20250208+cuda12.1.torch2.5.1 -f https://k2-fsa.github.io/k2/cuda.html

Please refer to https://k2-fsa.org/get-started/k2/ for details. Users in China mainland can refer to https://k2-fsa.org/zh-CN/get-started/k2/.

  • To check the k2 installation:
python3 -c "import k2; print(k2.__file__)"