Web Analytics

ThinkSound

⭐ 1043 stars Simplified Chinese by FunAudioLLM

ThinkSound

🌐 English | 简体中文 | 繁體中文 | Español | Français | 日本語

NeurIPS 2025

arXiv   Online Demo   Hugging Face   ModelScope

如果你觉得这个项目有用,
欢迎在 GitHub 上点个星 ⭐!


ThinkSound 是一个统一的 Any2Audio 生成框架,结合了由思维链(Chain-of-Thought, CoT)推理指导的流匹配方法。

用于多模态音频生成与编辑的 PyTorch 实现:可根据视频、文本和音频生成或编辑音频,由多模态大语言模型(MLLM)逐步推理驱动。

Teaser


📰 新闻

---

🚀 主要功能

---

✨ 方法概览

ThinkSound 将音频生成与编辑分为三个交互阶段,全部由 MLLM 基于链式思维(CoT)推理驱动:

ThinkSound Overview


⚡ 快速开始

环境准备:

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),并下载预训练模型——无需手动设置。
在运行脚本前,请确保已安装 condagit 并且它们已添加到系统 PATH 中。

▶️ 运行演示

#### Linux/macOS

chmod +x scripts/demo.sh
./scripts/demo.sh   <CoT description> [use-half]</code></pre>
#### <strong>Windows</strong></p><p>你也可以使用提供的 <code>.bat</code> 脚本来代替:</p><pre><code class="language-bash">.\scripts\demo.bat <path-to-your-demo-video> <title> <CoT description> [use-half]</code></pre>
<strong>注意:</strong></p><ul><li><code><path-to-your-demo-video></code>:单个视频的路径</li>
<li><code>[use-half]</code>(可选):在末尾添加 use-half 以启用半精度特征提取功能。</li></p><p></ul>---</p><h3>📦 批量推理</h3></p><p>#### <strong>Linux/macOS</strong></p><pre><code class="language-bash">chmod +x scripts/eval_batch.sh
./scripts/eval_batch.sh <video_path> <csv_path> <save_path (optional)> [use-half]</code></pre>
#### <strong>Windows</strong></p><p>请使用等效的 <code>.bat</code> 脚本:</p><pre><code class="language-bash">.\scripts\eval_batch.bat <video_path> <csv_path> <save_path (optional)> [use-half]</code></pre>
<strong>注意:</strong></p><ul><li><code><video_path></code>:包含所有待处理 .mp4 视频的根目录路径(所有视频必须时长相同)。</li>
<li><code><csv_path></code>:为每个视频提供文本提示的 CSV 文件(格式参考 <code>demo_test.csv</code>)。</li>
<li><code><save_path></code>(可选):生成音频的保存位置。默认为 <code>results/features</code>。</li>
<li><code>[use-half]</code>(可选):在末尾添加 use-half 以启用半精度特征提取。</li></p><p></ul>---</p><h3>网页界面使用方法</h3></p><p>如需交互式体验,可启动 Gradio 网页界面:</p><pre><code class="language-bash">python app.py</code></pre></p><h2>🏋️ 训练模型</h2></p><p>请参阅 <a href="https://raw.githubusercontent.com/FunAudioLLM/ThinkSound/master/docs/Training.md" target="_blank" rel="noopener noreferrer"><code>Training.md</code></a></p><hr></p><h2>📝 待办事项与未来规划</h2>
<ul><li>- [ ] 发布更强大的基础模型,覆盖多个领域,提供更具吸引力和沉浸感的拟音创作</li>
<li>- [ ] 增加对更多模态和下游任务的支持</li>
<li>- [ ] 发布不同规模的模型</li>
<li>- [x] 开源 AudioCoT 数据集和自动化流程</li>
<li>- [x] 发布 ThinkSound 模型的训练脚本</li>
<li>- [x] 提供面向初学者的 Windows 快速入门 README</li>
</ul>---</p><h2>📄 许可证</h2></p><p>本项目采用 Apache 2.0 许可证发布。</p><blockquote><strong>注意:</strong></blockquote>
<blockquote>代码、模型和数据集仅用于<strong>科研和教育目的</strong>。</blockquote>
<blockquote><strong>禁止商业用途。</strong></blockquote>
<blockquote>如需商业授权,请联系作者。</blockquote></p><p><strong>📦 第三方组件</strong></p><ul><li><strong>Stable Audio Open VAE</strong>(由 Stability AI 提供):</li>
  </ul>本仓库包含来自 <a href="https://huggingface.co/stabilityai/stable-audio-open-1.0/" target="_blank" rel="noopener noreferrer">Stable Audio Open</a> 的微调 VAE,遵循 <a href="https://raw.githubusercontent.com/FunAudioLLM/ThinkSound/master/./third_party/LICENSE_StabilityAI.md" target="_blank" rel="noopener noreferrer">Stability AI Community License</a> 授权。
  <strong>商业使用和再分发需事先获得 Stability AI 的许可。</strong></p><ul><li>📘 <strong>所有其他代码和模型</strong>均采用 Apache License 2.0 许可发布。</li></p><p></ul>---</p><h2>致谢</h2></p><p>特别感谢:</p><ul><li><strong>stable-audio-tools</strong>(由 Stability AI 提供):</li>
</ul>为音频生成提供了易用的框架,以及 VAE 模块和权重。
<ul><li><strong>MMAudio</strong>:</li>
  </ul>在音频领域实现了 MM-DiT 主干网络。</p><hr></p><h2>📖 引用</h2></p><p>如果您在研究或工作中发现 ThinkSound 有用,请引用我们的论文:</p><pre><code class="language-bibtex">@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}, 
}</code></pre></p><hr></p><h2>📬 Contact</h2></p><p>
✨ Feel free to <a href="https://github.com/liuhuadai/ThinkSound/issues" target="_blank" rel="noopener noreferrer">open an issue</a> or contact us via email (<a href="https://raw.githubusercontent.com/FunAudioLLM/ThinkSound/master/mailto:liuhuadai@zju.edu.cn" target="_blank" rel="noopener noreferrer">liuhuadai@zju.edu.cn</a>) if you have any questions or suggestions!</p><p>


---


Tranlated By <a href="https://github.com/OpenAiTx/OpenAiTx" target="_blank" rel="noopener noreferrer">Open Ai Tx</a> | Last indexed: 2025-10-04


---</p>
        </div>
        
        <div class="original-link">
            <strong>Original README:</strong> <a href="https://raw.githubusercontent.com/FunAudioLLM/ThinkSound/master/README.md" target="_blank" rel="noopener noreferrer">View on GitHub</a>
        </div>
    </div>
    
    <div class="footer">
        <p>Translated by <a href="https://github.com/OpenAiTx/OpenAiTx" target="_blank" rel="noopener noreferrer">OpenAiTx</a> | 
        Last updated: 2025-10-04 
    </div>
    
</body>
</html>