官方模型
Spark-TTS: 基于LLM的高效文本转语音模型,采用单流解耦语音令牌
Spark-TTS 是一款先进的文本转语音系统,它借助大型语言模型(LLM)的强大能力,实现了高度准确且自然的语音合成。其设计兼顾高效性、灵活性和强大性能,适用于研究与生产环境。
语音克隆推理概述![]() |
可控生成推理概述![]() |
克隆并安装
git clone https://github.com/SparkAudio/Spark-TTS.git
cd Spark-TTSconda 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模型下载
通过 Python 下载:
from huggingface_hub import snapshot_download
snapshot_download("SparkAudio/Spark-TTS-0.5B", local_dir="pretrained_models/Spark-TTS-0.5B")通过 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基本用法
您可以通过以下命令简单运行演示:
cd example
bash infer.sh或者,您可以直接在命令行中执行以下命令进行推理:
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"界面使用说明
您可以通过运行 python webui.py 启动界面,该界面支持语音克隆和语音创建功能。语音克隆支持上传参考音频或直接录制音频。
| 语音克隆 | 语音创建 |
|---|---|
![]() | ![]() |
@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},
}由于部分训练数据的许可条款限制,模型许可证已从 Apache 2.0 更新为 CC BY-NC-SA。
主要变更:
模型仅可用于非商业目的。
任何修改或衍生作品也必须在 CC BY-NC-SA 4.0 许可下发布。
使用或修改模型时,必须进行适当的署名。
请确保遵守新的许可条款。
本项目提供零样本语音克隆 TTS 模型,旨在用于学术研究、教育目的以及合法应用,例如个性化语音合成、辅助技术和语言学研究。
请注意:
请勿将本模型用于未经授权的语音克隆、冒充、欺诈、诈骗、深度伪造或任何非法活动。
使用本模型时,请确保遵守当地法律法规并坚守道德标准。
开发者对本模型的任何滥用不承担责任。
我们倡导负责任地开发和使用 AI,并鼓励社区在 AI 研究和应用中坚守安全与道德原则。如果您对伦理或滥用问题有任何担忧,请与我们联系。