Skip to content

chaye7417/ComfyUI_NotaGen

 
 

Repository files navigation

ComfyUI NotaGen - AI 乐谱生成节点

NotaGen 是一个 AI 符号音乐生成工具,可以生成巴洛克、古典、浪漫时期风格的乐谱,支持 60+ 位作曲家风格。

原项目: ElectricAlexis/NotaGen

11.19.mp4

界面截图


📣 更新日志

[2025-04-09] 不再需要手动输入 MuseScore4 路径,只需将安装目录添加到系统 PATH 环境变量即可。

[2025-03-21] 增加更多可调参数,可选是否卸载模型。

[2025-03-15] 支持 Linux Ubuntu/Debian 系列及服务器环境。

[2025-03-13] 生成 .abc 自动转换为 .xml.mp3.png 格式,可以听音乐并查看乐谱。


安装指南

macOS 用户

请参阅 INSTALL-MacOS.md - 完整的 macOS 安装步骤(推荐)

Windows / Linux 用户

cd ComfyUI/custom_nodes
git clone https://github.com/chaye7417/ComfyUI_NotaGen.git
cd ComfyUI_NotaGen
pip install -r requirements.txt

Windows python_embeded 环境:

./python_embeded/python.exe -m pip install -r requirements.txt

Linux 需要额外安装:

sudo apt update
sudo apt install musescore
sudo apt install libxcb-xinerama0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0

# 服务器环境还需要安装虚拟显示器
sudo apt install xvfb

模型下载

将模型下载到 ComfyUI/models/TTS/NotaGen/ 目录,并按要求重命名:

模型 大小 下载链接
notagenx.pth(推荐) 6.2GB 下载
notagen_small.pth 110MB 下载
notagen_medium.pth 244MB 下载
notagen_large.pth 516MB 下载
default.mp4

使用方法

1. 添加节点

在 ComfyUI 中:右键Add Node🎤MWMW-NotaGenNotaGen Run

2. 连接输出

NotaGen Run
    ├── audio → PreviewAudio (播放音频)
    └── score → PreviewImage (显示乐谱)

3. 参数设置

参数 说明 默认值
model 模型文件 notagenx.pth
period 时期 Romantic
composer 作曲家 Bach, Johann Sebastian
instrumentation 乐器类型 Keyboard
custom_prompt 自定义提示(格式: 时期 | 作曲家 | 乐器 -
temperature 生成随机性(0-5,越高越随机) 0.8
top_k Top-K 采样 50
top_p Top-P 采样 0.95
seed 随机种子(0=随机) 0
unload_model 生成后卸载模型 true

可用风格

时期 (Period)

  • Baroque(巴洛克):Bach, Corelli, Handel, Scarlatti, Vivaldi
  • Classical(古典):Beethoven, Haydn, Mozart 等
  • Romantic(浪漫):Chopin, Liszt, Brahms, Debussy, Ravel, Tchaikovsky 等 40+ 位作曲家

乐器类型 (Instrumentation)

  • Chamber - 室内乐
  • Choral - 合唱
  • Keyboard - 键盘乐器(钢琴等)
  • Orchestral - 管弦乐
  • Vocal-Orchestral - 声乐与管弦乐
  • Art Song - 艺术歌曲

输出文件

生成完成后,文件保存在:

  • ComfyUI/output/notagen_interleaved/ - 处理后的文件(.abc, .xml, .mp3, .png)
  • ComfyUI/output/notagen_original/ - 原始生成文件

常见问题

详见 INSTALL-MacOS.md 中的常见问题章节。


相关链接


鸣谢

About

Symbolic Music Generation, NotaGen node for ComfyUI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%