开源项目解析
stable-audio-tools
条件音频生成模型的训练与推理代码。**不是一个模型,是做模型的一套工具。**
训练与推理都给能训自己的音效模型这一格的底座
读懂层
2 张 · 架构图 / 时序图
DeepWiki · 抓取 2026-08-17 · 核验 2026-08-17
DeepWiki · 抓取 2026-08-17 · 核验 2026-08-17
它管哪几个决定
音乐与音效描述生成音乐
0/10 家有官方说法自持能力
动手层
还没做。装它要过哪几关、改哪个文件能改什么、坑在代码哪一处 —— 这三项要读源码,尚未完成。
教程
没找到官方口径的教程 —— 官方只给了 README。
项目自述
以下是仓库 README 的开头部分(原文引用,抓取 2026-08-17)。读全文 ↗
stable-audio-tools Training and inference code for audio generation models Install Requires PyTorch 2.5 or later for Flash Attention and Flex Attention support. Development for the repo is done in Python 3.10. We use uv for fast, reproducible dependency management. Install it with pip install uv or see the uv docs. Clone the repo and install dependencies: bash $ git clone https://github.com/Stability-AI/stable-audio-tools.git $ cd stable-audio-tools Inference only $ uv sync Training $ uv sync --extra train Everything (training + Gradio UI) $ uv sync --extra train --extra ui Flash Attention Flash Attention is recommended for performance. Follow the installation instructions in the Flash Attention repository to install it after running uv sync. Run scripts with uv run: bash $ uv run python train.py --dataset-config /path/to/config ... $ uv run python run_gradio.py --pretrained-name stabilityai/stable-audio-open-1.0 Alternatively, you can use pip directly: bash $ pip install "stable-audio-tools[train]" Interface A basic Gradio interface is provided to test out trained models. For example, to create an interface for the stable-audio-open-1.0 model, once you've accepted the terms for the model on Hugging Face, you can run: bash $ python3 ./run_gradio.py --pretrained-name stabilityai/stable-audio-open-1.0 The run_gradio.py script accepts the following command line arguments: - --pretrained-name - Hugging Face repository name for a Stable Audio Tools model - Will prioritize model.safetensors over model.ckpt in the repo - Optional, used in place of model-config and ckpt-path when using pre-trained model checkpoints on Hugging Face - --model-config - Path to the model config file for a local model - --ckpt-path - Path to unwrapped model checkpoint file for a local model - --pretransform-ckpt-path - Path to an unwrapped pretransform checkpoint, replaces the pretransform in the model, useful for testing out fine-tuned decoders - Optional - --share - If true, a publicly shareable link will be created for the Gradio demo - Optional - --username and --password - Used together to set a login for the Gradio demo - Optional - --model-half - If true, the model weights to half-precision - Optional Training Prerequisites Before starting your training run, you'll need a model config file, as well as a dataset config file. For more information about those, refer to the Configurations section below The training code also requires a Weights & Biases account to log the training outputs and demos. Create an account and log in with: bash $ wandb login Start training To start a training run, run the train.py script in the repo root with: bash $ python3 ./train.py --dataset-config /path/to/dataset/config --model-config /path/to/model/config --name harmonai_train The --name parameter will set the project name for your Weights and Biases run. Training wrappers and model unwrapping stable-audio-tools uses PyTorch Lightning to facilitate multi-GPU and multi-node training. When a model is being trained, it is wrapped in a "training wrapper", which is a pl.LightningModule that contains all of the relevant objects needed only ……(后略,见原文)
判断
优势
- 训练与推理都给,是这一格事实上的底座
- MIT,改了不用回馈
- 一直在维护,星数在音频生成里排前列
局限
- 要自己有数据、有算力 —— 训练不是配好就能跑
- 它不带现成的音效模型,得自己训或接别人的权重
- 门槛明显高于「装上就出声」的那一类
不适用
只想出几个音效就走 —— 那用现成模型。
同管这些决定的其它项目
github README + DeepWiki · 核验 2026-10-19 | 判断栏可报错。