ThinkSound
🌐 English | 简体中文 | 繁體中文 | Español | Français | 日本語
如果你觉得这个项目有用,
欢迎在 GitHub 上点个星 ⭐!
ThinkSound 是一个统一的 Any2Audio 生成框架,结合了由思维链(Chain-of-Thought, CoT)推理指导的流匹配方法。 PyTorch 实现的多模态音频生成与编辑:可根据视频、文本和音频生成或编辑音频,依托于多模态大语言模型(MLLMs)逐步推理。
📰 新闻
- 2025.11.25 🔥PrismAudio 在线演示上线 - 立即体验!
- 2025.11.25 🔥PrismAudio 论文已在 arXiv 发布,首个面向视频转音频生成的多维 CoT-RL 框架!
- 2025.09.19 🎉 ThinkSound 已被 NeurIPS 2025 主会录用!
- 2025.09.01 我们的 AudioCoT 数据集已开源并可在 Hugging Face 获取!
- 2025.07.17 🧠 已支持微调:训练及微调代码现已公开,配有详细使用说明,助您用自有数据定制扩展 ThinkSound。
- 2025.07.15 📦 安装与易用性简化:依赖已上架 PyPI,便于跨平台部署;Windows
.bat脚本自动化环境创建与脚本运行。 - 2025.07.08 🔧 重大更新:模型瘦身,优化内存与 GPU 占用,现已支持大规模高吞吐音频生成!
- 2025.07.01 Hugging Face Spaces 及 ModelScope 提供在线交互体验!
- 2025.07.01 推出推理脚本与网页界面;
- 2025.06 ThinkSound 论文已在 arXiv 发布!
- 2025.06 在线演示已上线 - 立即试用!
🚀 特性
- Any2Audio:支持任意模态(视频、文本、音频或其组合)生成音频。
- 视频转音频 SOTA:在多项 V2A 基准上达到最先进效果。
- CoT 驱动推理:通过 MLLM 的链式思维推理,实现可组合、可控的音频生成。
- 交互式物体编辑:通过点击视觉对象或文本指令,细化或编辑特定声音事件。
- 统一框架:单一基础模型同时支持生成、编辑与交互式流程。
✨ 方法概述
ThinkSound 将音频生成与编辑拆解为三个由 MLLM 链式思维(CoT)推理驱动的交互阶段:
- 拟音生成: 从视频生成语义与时间对齐的基础音景。
- 基于物体的细化: 通过点击或圈定视频中用户指定的对象,细化或添加声音。
- 目标音频编辑: 利用高阶自然语言指令修改生成的音频。
⚡ 快速开始
环境准备:
git clone https://github.com/liuhuadai/ThinkSound.git
cd ThinkSound
conda create -n thinksound python=3.10
conda activate thinksound
pip install thinksound
conda install -y -c conda-forge 'ffmpeg<7'
Download pretrained weights https://huggingface.co/liuhuadai/ThinkSound to Directory ckpts/
model weights can be also downloaded from https://www.modelscope.cn/models/iic/ThinkSound
git lfs install
git clone https://huggingface.co/liuhuadai/ThinkSound ckpts
To improve inference and training speed, you may optionally install a FlashAttention backend compatible with your system and PyTorch version.
✅ Windows 提示:
Windows 用户只需运行 setup_windows.bat(或双击它),即可自动创建 conda 环境、安装所有依赖项(包括 FFmpeg),并下载预训练模型——无需手动设置。
在运行脚本前,请确保已安装conda和git并且它们已添加到系统 PATH 中。
▶️ 运行演示
#### Linux/macOS
chmod +x scripts/demo.sh
./scripts/demo.sh [use-half]
#### Windows你也可以使用提供的 .bat 脚本来代替:
.\scripts\demo.bat [use-half]
注意::单个视频的路径[use-half](可选):在末尾添加 use-half 以启用半精度特征提取功能。
📦 批量推理
#### Linux/macOS
chmod +x scripts/eval_batch.sh
./scripts/eval_batch.sh [use-half]
#### Windows请使用等效的 .bat 脚本:
.\scripts\eval_batch.bat [use-half]
注意::包含所有待处理 .mp4 视频的根目录路径(所有视频必须时长相同)。:为每个视频提供文本提示的 CSV 文件(格式参考demo_test.csv)。(可选):生成音频的保存位置。默认为results/features。[use-half](可选):在末尾添加 use-half 以启用半精度特征提取。
网页界面使用方法
如需交互式体验,可启动 Gradio 网页界面:
python app.py🏋️ 训练模型
请参阅 Training.md
📝 待办事项与未来规划
- - [ ] 发布更强大的基础模型,覆盖多个领域,提供更具吸引力和沉浸感的拟音创作
- - [ ] 增加对更多模态和下游任务的支持
- - [ ] 发布不同规模的模型
- - [x] 开源 AudioCoT 数据集和自动化流程
- - [x] 发布 ThinkSound 模型的训练脚本
- - [x] 提供面向初学者的 Windows 快速入门 README
📄 许可证
本项目采用 Apache 2.0 许可证发布。
注意:
代码、模型和数据集仅用于科研和教育目的。
禁止商业用途。
如需商业授权,请联系作者。
📦 第三方组件
- Stable Audio Open VAE(由 Stability AI 提供):
- 📘 所有其他代码和模型均采用 Apache License 2.0 许可发布。
致谢
特别感谢:
- stable-audio-tools(由 Stability AI 提供):
- MMAudio:
📖 引用
如果您在研究或工作中发现 ThinkSound 有用,请引用我们的论文:
@misc{liu2025thinksoundchainofthoughtreasoningmultimodal,
title={ThinkSound: Chain-of-Thought Reasoning in Multimodal Large Language Models for Audio Generation and Editing},
author={Huadai Liu and Jialei Wang and Kaicheng Luo and Wen Wang and Qian Chen and Zhou Zhao and Wei Xue},
year={2025},
eprint={2506.21448},
archivePrefix={arXiv},
primaryClass={eess.AS},
url={https://arxiv.org/abs/2506.21448},
}📬 Contact
✨ Feel free to open an issue or contact us via email (liuhuadai@zju.edu.cn) if you have any questions or suggestions!
--- Tranlated By Open Ai Tx | Last indexed: 2026-01-07 ---