Web Analytics

ThinkSound

⭐ 1043 stars Traditional 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 實現多模態音訊生成與編輯:由影片、文字和音訊生成或編輯音訊,結合多模態大型語言模型(MLLMs)逐步推理技術。

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>