VoxCPM2

提供商openbmb
分类text-to-speech
许可证apache-2.0
下载量271.9K
星标214

简介

VoxCPM2 是由 OpenBMB 推出的开源文本转语音(TTS)模型,旨在提供更自然、更具情感表现力的语音合成体验。不同于传统的机械合成音,它在语调起伏和自然度上做了深度优化,能够较好地还原人类说话的节奏感。对于开发者而言,该模型采用 Apache-2.0 协议,部署门槛较低,非常适合集成到智能助手、有声书制作或游戏 NPC 对话等需要高质量语音输出的场景中,是目前国产开源 TTS 方案中一个极具竞争力的选择。

核心亮点

  • 语音自然度高,有效告别机械感
  • Apache-2.0 协议,商业部署无压力
  • 支持多种情感表达,适用场景广泛
  • 轻量化设计,上手难度低且推理快

使用方法

安装依赖
# 安装 Hugging Face transformers
pip install transformers torch
SDK 使用
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("openbmb/VoxCPM2")
tokenizer = AutoTokenizer.from_pretrained("openbmb/VoxCPM2")

Hugging Face 下载

我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。

操作指引:在下载前,请先通过如下命令安装 huggingface_hub:

操作指引
pip install -U huggingface_hub

命令行下载

下载完整模型库

下载完整模型库
huggingface-cli download openbmb/VoxCPM2

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download openbmb/VoxCPM2 config.json --local-dir ./dir

更多命令行下载选项,可参见官方文档

SDK 下载

SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('openbmb/VoxCPM2')

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://huggingface.co/openbmb/VoxCPM2

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/openbmb/VoxCPM2

模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。

PyTorch / Transformers 使用

安装 Transformers

安装 Transformers
pip install -U transformers torch

模型加载和推理

模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('openbmb/VoxCPM2')
tokenizer = AutoTokenizer.from_pretrained('openbmb/VoxCPM2')

模型下载

我们推荐使用命令行或者 ModelScope SDK 来进行模型的下载。

操作指引:在下载前,请先通过如下命令安装 ModelScope:

操作指引
pip install modelscope

命令行下载

下载完整模型库

下载完整模型库
modelscope download --model openbmb/VoxCPM2

下载单个文件到指定本地文件夹(以下载 README.md 到当前路径下 dir 目录为例)

下载单个文件到指定本地文件夹(以下载 README.md 到当前路径下 dir 目录为例)
modelscope download --model openbmb/VoxCPM2 README.md --local_dir ./dir

更多更丰富的命令行下载选项,可参见具体文档

SDK 下载

SDK 下载
# 模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('openbmb/VoxCPM2')

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://www.modelscope.cn/openbmb/VoxCPM2.git

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://www.modelscope.cn/openbmb/VoxCPM2.git

ModelScope 模型页直接下载模型文件;无需将模型文件放在本站服务器。

Notebook 快速开发

下载并安装 ModelScope library

下载并安装 ModelScope library
pip install "modelscope[audio,cv,nlp,multi-modal,science]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html

模型加载和推理

模型加载和推理
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

p = pipeline('text-generation', 'openbmb/VoxCPM2')

完整文档

来源: HuggingFace

---
language:

  • zh

  • en

  • ar

  • my

  • da

  • nl

  • fi

  • fr

  • de

  • el

  • he

  • hi

  • id

  • it

  • ja

  • km

  • ko

  • lo

  • ms

  • no

  • pl

  • pt

  • ru

  • es

  • sw

  • sv

  • tl

  • th

  • tr

  • vi

license: apache-2.0
library_name: voxcpm
tags:
  • text-to-speech

  • tts

  • multilingual

  • voice-cloning

  • voice-design

  • diffusion

  • audio

pipeline_tag: text-to-speech
---

VoxCPM2

VoxCPM2 is a tokenizer-free, diffusion autoregressive Text-to-Speech model — 2B parameters, 30 languages, 48kHz audio output, trained on over 2 million hours of multilingual speech data.

![GitHub](https://github.com/OpenBMB/VoxCPM)
![Docs](https://voxcpm.readthedocs.io/en/latest/)
![Demo](https://huggingface.co/spaces/OpenBMB/VoxCPM-Demo)
![Audio Samples](https://openbmb.github.io/voxcpm2-demopage)
![Discord](https://discord.gg/KZUx7tVNwz)
![Lark](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=acds0b9d-23d8-4d7e-b696-d200f3e22a7f) ![MiniCPM Wiki](https://modelbest.feishu.cn/wiki/UtWxwcERfiRIpIkBOjuc3h9tn1D)

Highlights

  • 🌍 30-Language Multilingual — No language tag needed; input text in any supported language directly
  • 🎨 Voice Design — Generate a novel voice from a natural-language description alone (gender, age, tone, emotion, pace…); no reference audio required
  • 🎛️ Controllable Cloning — Clone any voice from a short clip, with optional style guidance to steer emotion, pace, and expression while preserving timbre
  • 🎙️ Ultimate Cloning — Provide reference audio + its transcript for audio-continuation cloning; every vocal nuance faithfully reproduced
  • 🔊 48kHz Studio-Quality Output — Accepts 16kHz reference; outputs 48kHz via AudioVAE V2's built-in super-resolution, no external upsampler needed
  • 🧠 Context-Aware Synthesis — Automatically infers appropriate prosody and expressiveness from text content
  • Real-Time Streaming — RTF as low as ~0.3 on NVIDIA RTX 4090, and ~0.13 accelerated by Nano-VLLM
  • 📜 Fully Open-Source & Commercial-Ready — Apache-2.0 license, free for commercial use

<summary><b>Supported Languages (30)</b></summary>

Arabic, Burmese, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Indonesian, Italian, Japanese, Khmer, Korean, Lao, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, Tagalog, Thai, Turkish, Vietnamese

Chinese Dialects: 四川话, 粤语, 吴语, 东北话, 河南话, 陕西话, 山东话, 天津话, 闽南话

Quick Start

Installation

bash
pip install voxcpm

Requirements: Python ≥ 3.10, PyTorch ≥ 2.5.0, CUDA ≥ 12.0 · Full Quick Start →

Text-to-Speech

python
from voxcpm import VoxCPM
import soundfile as sf

model = VoxCPM.from_pretrained("openbmb/VoxCPM2", load_denoiser=False)

wav = model.generate(
text="VoxCPM2 brings multilingual support, creative voice design, and controllable voice cloning.",
cfg_value=2.0,
inference_timesteps=10,
)
sf.write("output.wav", wav, model.tts_model.sample_rate)

Voice Design

Put the voice description in parentheses at the start of text, followed by the content to synthesize:

python
wav = model.generate(
    text="(A young woman, gentle and sweet voice)Hello, welcome to VoxCPM2!",
    cfg_value=2.0,
    inference_timesteps=10,
)
sf.write("voice_design.wav", wav, model.tts_model.sample_rate)

Controllable Voice Cloning

python
# Basic cloning
wav = model.generate(
    text="This is a cloned voice generated by VoxCPM2.",
    reference_wav_path="speaker.wav",
)
sf.write("clone.wav", wav, model.tts_model.sample_rate)

Cloning with style control

wav = model.generate( text="(slightly faster, cheerful tone)This is a cloned voice with style control.", reference_wav_path="speaker.wav", cfg_value=2.0, inference_timesteps=10, ) sf.write("controllable_clone.wav", wav, model.tts_model.sample_rate)

Ultimate Cloning

Provide both the reference audio and its exact transcript for maximum fidelity. Pass the same clip to both reference_wav_path and prompt_wav_path for highest similarity:

python
wav = model.generate(
    text="This is an ultimate cloning demonstration using VoxCPM2.",
    prompt_wav_path="speaker_reference.wav",
    prompt_text="The transcript of the reference audio.",
    reference_wav_path="speaker_reference.wav",
)
sf.write("hifi_clone.wav", wav, model.tts_model.sample_rate)

Streaming

python
import numpy as np

chunks = []
for chunk in model.generate_streaming(text="Streaming is easy with VoxCPM!"):
chunks.append(chunk)
wav = np.concatenate(chunks)
sf.write("streaming.wav", wav, model.tts_model.sample_rate)

Model Details

| Property | Value |
|---|---|
| Architecture | Tokenizer-free Diffusion Autoregressive (LocEnc → TSLM → RALM → LocDiT) |
| Backbone | Based on MiniCPM-4, totally 2B parameters |
| Audio VAE | AudioVAE V2 (asymmetric encode/decode, 16kHz in → 48kHz out) |
| Training Data | 2M+ hours multilingual speech |
| LM Token Rate | 6.25 Hz |
| Max Sequence Length | 8192 tokens |
| dtype | bfloat16 |
| VRAM | ~8 GB |
| RTF (RTX 4090) | ~0.30 (standard) / ~0.13 (Nano-vLLM) |

Performance

VoxCPM2 achieves state-of-the-art or competitive results on major zero-shot and controllable TTS benchmarks.

See the GitHub repo for full benchmark tables (Seed-TTS-eval, CV3-eval, InstructTTSEval, MiniMax Multilingual Test).

Fine-tuning

VoxCPM2 supports both full SFT and LoRA fine-tuning with as little as 5–10 minutes of audio:

bash
# LoRA fine-tuning (recommended)
python scripts/train_voxcpm_finetune.py \
    --config_path conf/voxcpm_v2/voxcpm_finetune_lora.yaml

Full fine-tuning

python scripts/train_voxcpm_finetune.py \ --config_path conf/voxcpm_v2/voxcpm_finetune_all.yaml

See the Fine-tuning Guide for full instructions.

Limitations

  • Voice Design and Style Control results may vary between runs; generating 1–3 times is recommended to obtain the desired output.
  • Performance varies across languages depending on training data availability.
  • Occasional instability may occur with very long or highly expressive inputs.
  • Strictly forbidden to use for impersonation, fraud, or disinformation. AI-generated content should be clearly labeled.

Citation

bibtex
@article{voxcpm2_2026,
  title   = {VoxCPM2: Tokenizer-Free TTS for Multilingual Speech Generation, Creative Voice Design, and True-to-Life Cloning},
  author  = {VoxCPM Team},
  journal = {GitHub},
  year    = {2026},
}

@article{voxcpm2025,
title = {VoxCPM: Tokenizer-Free TTS for Context-Aware Speech Generation and True-to-Life Voice Cloning},
author = {Zhou, Yixuan and Zeng, Guoyang and Liu, Xin and Li, Xiang and
Yu, Renjie and Wang, Ziyang and Ye, Runchuan and Sun, Weiyue and
Gui, Jiancheng and Li, Kehan and Wu, Zhiyong and Liu, Zhiyuan},
journal = {arXiv preprint arXiv:2509.24650},
year = {2025},
}

License

Released under the Apache-2.0 license, free for commercial use. For production deployments, we recommend thorough testing and safety evaluation tailored to your use case.