Views
No views yet
pip install voxcpm1from voxcpm import VoxCPM
2import soundfile as sf
3
4model = VoxCPM.from_pretrained("openbmb/VoxCPM2", load_denoiser=False)
5
6wav = model.generate(
7 text="VoxCPM2 brings multilingual support, creative voice design, and controllable voice cloning.",
8 cfg_value=2.0,
9 inference_timesteps=10,
10)
11sf.write("output.wav", wav, model.tts_model.sample_rate)text, followed by the content to synthesize:1wav = model.generate(
2 text="(A young woman, gentle and sweet voice)Hello, welcome to VoxCPM2!",
3 cfg_value=2.0,
4 inference_timesteps=10,
5)
6sf.write("voice_design.wav", wav, model.tts_model.sample_rate)1# Basic cloning
2wav = model.generate(
3 text="This is a cloned voice generated by VoxCPM2.",
4 reference_wav_path="speaker.wav",
5)
6sf.write("clone.wav", wav, model.tts_model.sample_rate)
7
8# Cloning with style control
9wav = model.generate(
10 text="(slightly faster, cheerful tone)This is a cloned voice with style control.",
11 reference_wav_path="speaker.wav",
12 cfg_value=2.0,
13 inference_timesteps=10,
14)
15sf.write("controllable_clone.wav", wav, model.tts_model.sample_rate)reference_wav_path and prompt_wav_path for highest similarity:1wav = model.generate(
2 text="This is an ultimate cloning demonstration using VoxCPM2.",
3 prompt_wav_path="speaker_reference.wav",
4 prompt_text="The transcript of the reference audio.",
5 reference_wav_path="speaker_reference.wav",
6)
7sf.write("hifi_clone.wav", wav, model.tts_model.sample_rate)1import numpy as np
2
3chunks = []
4for chunk in model.generate_streaming(text="Streaming is easy with VoxCPM!"):
5 chunks.append(chunk)
6wav = np.concatenate(chunks)
7sf.write("streaming.wav", wav, model.tts_model.sample_rate)| 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) |
1# LoRA fine-tuning (recommended)
2python scripts/train_voxcpm_finetune.py \
3 --config_path conf/voxcpm_v2/voxcpm_finetune_lora.yaml
4
5# Full fine-tuning
6python scripts/train_voxcpm_finetune.py \
7 --config_path conf/voxcpm_v2/voxcpm_finetune_all.yaml1@article{voxcpm2_2026,
2 title = {VoxCPM2: Tokenizer-Free TTS for Multilingual Speech Generation, Creative Voice Design, and True-to-Life Cloning},
3 author = {VoxCPM Team},
4 journal = {GitHub},
5 year = {2026},
6}
7
8@article{voxcpm2025,
9 title = {VoxCPM: Tokenizer-Free TTS for Context-Aware Speech Generation and True-to-Life Voice Cloning},
10 author = {Zhou, Yixuan and Zeng, Guoyang and Liu, Xin and Li, Xiang and
11 Yu, Renjie and Wang, Ziyang and Ye, Runchuan and Sun, Weiyue and
12 Gui, Jiancheng and Li, Kehan and Wu, Zhiyong and Liu, Zhiyuan},
13 journal = {arXiv preprint arXiv:2509.24650},
14 year = {2025},
15}