environmental preparation
- hardware requirement:配备NVIDIA GPU的计算机(推荐显存≥16GB)
- 软件基础:Python≥3.8 + CUDA 11.8环境
- Dependent Installation::
pip install -r requirements.txt
+ FlashAttention 2优化包
workflow
- 歌词准备:将纯文本歌词保存为UTF-8编码的.txt文件(建议每行对应一个乐句)
- 基础生成命令::
python generate_song.py --lyrics lyrics.txt --output song.wav
- 高级参数调整: can be accessed through
--style
指定音乐风格(pop/metal等),用--vocal
选择声乐类型
Practical advice
对于中文用户,建议在歌词文件中加入拼音注音以改善旋律自然度;生成时可先用30秒短片段测试(添加--duration 30
参数)再生成完整版本。
This answer comes from the articleYuE: Transforms lyrics into a base model of a complete song, supporting a wide range of musical stylesThe