Spark-TTS README

The project's README from github.com/SparkAudio/Spark-TTS. As one markdown file: README.md.

Spark-TTS

Official PyTorch code for inference of
Spark-TTS: An Efficient LLM-Based Text-to-Speech Model with Single-Stream Decoupled Speech Tokens

Spark-TTS Logo

Institution 1 Institution 2 Institution 3

Institution 4 Institution 5 Institution 6

paper version Hugging Face version version python mit

Spark-TTS 🔥

Overview

Spark-TTS is an advanced text-to-speech system that uses the power of large language models (LLM) for highly accurate and natural-sounding voice synthesis. It is designed to be efficient, flexible, and powerful for both research and production use.

Key Features


Inference Overview of Voice Cloning
Inference Overview of Controlled Generation

🚀 News

Install

Clone and Install

Here are instructions for installing on Linux. If you're on Windows, please refer to the Windows Installation Guide.
(Thanks to @AcTePuKc for the detailed Windows instructions!)

git clone https://github.com/SparkAudio/Spark-TTS.git
cd Spark-TTS
conda create -n sparktts -y python=3.12
conda activate sparktts
pip install -r requirements.txt
# If you are in mainland China, you can set the mirror as follows:
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com

Model Download

Download via python:

from huggingface_hub import snapshot_download

snapshot_download("SparkAudio/Spark-TTS-0.5B", local_dir="pretrained_models/Spark-TTS-0.5B")

Download via git clone:

mkdir -p pretrained_models

# Make sure you have git-lfs installed (https://git-lfs.com)
git lfs install

git clone https://huggingface.co/SparkAudio/Spark-TTS-0.5B pretrained_models/Spark-TTS-0.5B

Basic Usage

You can simply run the demo with the following commands:

cd example
bash infer.sh

Alternatively, you can directly execute the following command in the command line to perform inference:

python -m cli.inference \
    --text "text to synthesis." \
    --device 0 \
    --save_dir "path/to/save/audio" \
    --model_dir pretrained_models/Spark-TTS-0.5B \
    --prompt_text "transcript of the prompt audio" \
    --prompt_speech_path "path/to/prompt_audio"

Web UI Usage

You can start the UI interface by running python webui.py --device 0, which allows you to perform Voice Cloning and Voice Creation. Voice Cloning supports uploading reference audio or directly recording the audio.

Voice Cloning Voice Creation
Image 1 Image 2

Optional Methods

For additional CLI and Web UI methods, including alternative implementations and extended functionalities, you can refer to:

Runtime

Nvidia Triton Inference Serving

We now provide a reference for deploying Spark-TTS with Nvidia Triton and TensorRT-LLM. The table below presents benchmark results on a single L20 GPU, using 26 different prompt_audio/target_text pairs (totalling 169 seconds of audio):

Model Note Concurrency Avg Latency RTF
Spark-TTS-0.5B Code Commit 1 876.24 ms 0.1362
Spark-TTS-0.5B Code Commit 2 920.97 ms 0.0737
Spark-TTS-0.5B Code Commit 4 1611.51 ms 0.0704

Please see the detailed instructions in runtime/triton_trtllm/README.md for more information.

Demos

Here are some demos generated by Spark-TTS using zero-shot voice cloning. For more demos, visit our demo page.


Donald Trump

Zhongli (Genshin Impact)

Donald Trump

Zhongli


陈鲁豫 Chen Luyu

杨澜 Yang Lan

陈鲁豫Chen_Luyu.webm

Yang_Lan.webm


余承东 Richard Yu

马云 Jack Ma

Yu_Chengdong.webm

Ma_Yun.webm


刘德华 Andy Lau

徐志胜 Xu Zhisheng

Liu_Dehua.webm

Xu_Zhisheng.webm


哪吒 Nezha

李靖 Li Jing

Ne_Zha.webm

Li_Jing.webm

To-Do List

Citation

@misc{wang2025sparktts,
      title={Spark-TTS: An Efficient LLM-Based Text-to-Speech Model with Single-Stream Decoupled Speech Tokens}, 
      author={Xinsheng Wang and Mingqi Jiang and Ziyang Ma and Ziyu Zhang and Songxiang Liu and Linqin Li and Zheng Liang and Qixi Zheng and Rui Wang and Xiaoqin Feng and Weizhen Bian and Zhen Ye and Sitong Cheng and Ruibin Yuan and Zhixian Zhao and Xinfa Zhu and Jiahao Pan and Liumeng Xue and Pengcheng Zhu and Yunlin Chen and Zhifei Li and Xie Chen and Lei Xie and Yike Guo and Wei Xue},
      year={2025},
      eprint={2503.01710},
      archivePrefix={arXiv},
      primaryClass={cs.SD},
      url={https://arxiv.org/abs/2503.01710}, 
}

⚠️ Usage Disclaimer

This project provides a zero-shot voice cloning TTS model intended for academic research, educational purposes, and legitimate applications, such as personalized speech synthesis, assistive technologies, and linguistic research.

Please note:

We advocate for the responsible development and use of AI and encourage the community to uphold safety and ethical principles in AI research and applications. If you have any concerns regarding ethics or misuse, please contact us.

Spark-TTS (SparkAudio/Spark-TTS)

Searching Database…

这是什么?Spark-TTS 是一个文本转语音系统,它基于大语言模型(以 Qwen2.5 为基础),能生成非常自然、准确的语音,还支持零样本语音克隆。
这是现成的应用,还是需要我自己运行的代码?这是需要你自己运行的 PyTorch 推理代码,可以通过命令行脚本运行,也可以启动自带的类 Gradio 网页界面(webui.py),它不是打包好的应用程序。
我该怎么把它跑起来?克隆仓库,创建 Conda 环境,下载模型(可以用 python 或 git clone),然后运行演示命令行脚本,或者用 'python webui.py --device 0' 启动网页界面。
试用之前需要先安装什么?你需要先安装 Conda 来配置 Python 环境,并下载好 Spark-TTS 模型权重;从 Nvidia Triton 的服务化基准测试来看,还需要一块 GPU。
训练代码也开放了吗?没有,目前只发布了推理代码;训练代码和 VoxBox 训练数据集还在待办清单上,尚未公开。
它只能在 Linux 上运行吗?主要说明针对 Linux,但社区贡献者编写了单独的 Windows 安装指南,所以也可以在 Windows 上运行。
有什么使用免责声明我需要知道吗?有的,作者明确警告不要将其用于未经授权的语音克隆、冒充、诈骗或深度伪造,对于滥用行为,作者不承担任何责任。
它能说多种语言吗?可以,它支持中文和英文双语,还能进行零样本跨语言及语码转换的语音克隆,也就是说,它可以在说话过程中切换语言,同时保持同一个克隆出来的声音。
没有参考录音,我能创建合成语音吗?可以,网页界面的“语音创建”模式允许你通过调整性别、音高、语速等参数来构建一个虚拟说话人,而不必克隆现有的声音。
用于生产环境服务时速度如何?在单块 Nvidia L20 GPU 上使用 Triton 和 TensorRT-LLM 的基准测试显示,根据并发量的不同,平均延迟约为 876 毫秒至 1.6 秒,RTF 最低可达 0.07。
为什么不像其他 TTS 系统那样使用流匹配(flow-matching)模型?Spark-TTS 完全基于 Qwen2.5 构建,直接从大语言模型预测的编码重建音频,无需单独的声学特征生成模型,从而简化了整个流程。
Creator
SparkAudio
Size
7 MB
Stars
11K
Updated
CommitApr 09
Age
1y
Commits · 90 Days