官方 PyTorch 实现
开源推荐
morning
GitHub 热门项目:FluxMusic
摘要
GitHub项目:FluxMusic 仓库地址:https://github.com/feizc/FluxMusic Stars:1712 | 作者:feizc 项目描述:Text-to-Music Generation with Rectified Flow Transformers ================================================== READM...
https
scripts
link
model
and
the
FluxMusic
with
ensp
training
2026-08-23
1 阅读
约5分钟阅读
GitHub Trending
字号:
GitHub 项目:FluxMusic
仓库地址:https://github.com/feizc/FluxMusic
星级:1712 | 作者:feizc
项目描述:使用整流流量变压器生成文本到音乐
===================================================
自述文件内容:
## FluxMusic:使用整流流转换器生成文本到音乐
官方 PyTorch 实现
该存储库包含 PyTorch 模型定义、预训练权重以及论文 *Flux that play music* 的训练/采样代码。
它探索了基于扩散的整流流变压器的简单扩展,用于文本到音乐的生成。模型架构如下:
官方 PyTorch 实现
### 待办事项列表
- [x] 训练/推理脚本
- [x] 干净的代码
- [x] 所有 ckpt 和部分数据集
### 1. 培训
您可以参考[链接](https://github.com/black-forest-labs/flux)搭建运行环境。
要使用 pytorch DDP 在一个节点上使用“N”个 GPU 在潜在空间训练中启动小型版本:
````bash
torchrun --nnodes=1 --nproc_per_node=N train.py \
--小版本\
--数据路径 xxx \
--global_batch_size 128
````
更多不同模型大小的脚本可以参考`scripts`文件方向。
### 2. 推理
我们包含一个 [`sample.py`](sample.py) 脚本,它根据 MusicFlux 模型的条件对音乐剪辑进行采样,如下所示:
````bash
python 示例.py \
--小版本\
--ckpt_path /路径/到/模型 \
--prompt_file config/example.txt
````
论文中使用的所有提示都在“config/example.txt”中列出。
### 3.下载Cckpts和数据
我们在 AudioLDM2、CLAP-L 和 T5-XXL 中使用 VAE 和声码器。您可以直接在下表中下载,我们还提供了实验中的训练脚本。
注意,在实际实验中,由于机器故障而进行了重启实验,因此部分脚本中会有恢复选项。
| 模型|训练步骤| 网址 |培训脚本|
|--------|--------|------------------|---------|
| VAE | -| [链接](https://huggingface.co/cvssp/audioldm2/tree/main/vae) | - |
|声码器|-| [链接](https://huggingface.co/cvssp/audioldm2/tree/main/vocoder) | - |
| T5-特大号| - | [链接](https://huggingface.co/stabilityai/stable-diffusion-3-medium-diffusers/tree/main/text_encoder_3) | - |
|拍手-L | -| [链接](https://huggingface.co/laion/larger_clap_music/tree/main) | - |
| FluxMusic-小| 20万| [链接](https://huggingface.co/feizhengcong/FluxMusic/blob/main/musicflow_s.pt) | [链接](https://github.com/feizc/FluxMusic/blob/main/scripts/train_s.sh) |
| Flux音乐基础 | 20万| [链接](https://huggingfa