
一、功能
HeartMuLa:一种音乐语言模型,可根据歌词和标签生成音乐,支持多种语言,包括但不限于英语、中文、日语、韩语和西班牙语。
HeartCodec:一种具有高重建保真度的 12.5 Hz 音乐编解码器;
HeartTranscriptor:一种基于耳语的模型,专门用于歌词转录;
HeartCLAP:一种音频-文本对齐模型,为音乐描述和跨模态检索建立统一的嵌入空间。
二、安装
1、安装最新版 ComfyUI 【点击下载】
2、进入到安装目录新建custom_nodes文件夹,进入CMD命令提示行。
git clone https://github.com/benjiyaya/HeartMuLa_ComfyUI
备用:https://github.com/xdwcode/HeartMuLa_ComfyUI
3、进入到文件夹下
cd HeartMuLa_ComfyUI
4、安装依赖
pip install -r requirements.txt
如果弹出模块名称错误提示,则某些库可能需要单独安装(Windows 用户需要以管理员身份使用命令提示符)。
执行以下命令:
pip install soundfile pip install torchtune pip install torchao
5、下载模型文件
前往 ComfyUI/models 目录。
使用 HuggingFace CLI 下载模型权重。
类型 :
hf download HeartMuLa/HeartMuLaGen --local-dir ./HeartMuLa hf download HeartMuLa/HeartMuLa-oss-3B --local-dir ./HeartMuLa/HeartMuLa-oss-3B hf download HeartMuLa/HeartCodec-oss-20260123 --local-dir ./HeartMuLa/HeartCodec-oss hf download HeartMuLa/HeartTranscriptor-oss --local-dir ./HeartMuLa/HeartTranscriptor-oss
6、工作流(需保存为Generate Music.json)
{
"id": "e0e2082e-ca0f-4bfc-95f3-c0707aafd8d2",
"revision": 0,
"last_node_id": 14,
"last_link_id": 11,
"nodes": [
{
"id": 13,
"type": "PreviewAudio",
"pos": [
969.9301686046895,
262.6232738552194
],
"size": [
403,
199
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"label": "audio",
"name": "audio",
"type": "AUDIO",
"link": 11
},
{
"label": "audioUI",
"name": "audioUI",
"type": "AUDIO_UI",
"widget": {
"name": "audioUI"
},
"link": null
}
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewAudio",
"cnr_id": "comfy-core",
"ver": "0.9.2"
},
"widgets_values": []
},
{
"id": 14,
"type": "HeartMuLa_Generate",
"pos": [
462.7272644042969,
260.53482604940393
],
"size": [
447.8109335379886,
510.8094741970325
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [
{
"label": "lyrics",
"name": "lyrics",
"type": "STRING",
"widget": {
"name": "lyrics"
},
"link": null
},
{
"label": "tags",
"name": "tags",
"type": "STRING",
"widget": {
"name": "tags"
},
"link": null
},
{
"label": "version",
"name": "version",
"type": "COMBO",
"widget": {
"name": "version"
},
"link": null
},
{
"label": "seed",
"name": "seed",
"type": "INT",
"widget": {
"name": "seed"
},
"link": null
},
{
"label": "max_audio_length_seconds",
"name": "max_audio_length_seconds",
"type": "INT",
"widget": {
"name": "max_audio_length_seconds"
},
"link": null
},
{
"label": "topk",
"name": "topk",
"type": "INT",
"widget": {
"name": "topk"
},
"link": null
},
{
"label": "temperature",
"name": "temperature",
"type": "FLOAT",
"widget": {
"name": "temperature"
},
"link": null
},
{
"label": "cfg_scale",
"name": "cfg_scale",
"type": "FLOAT",
"widget": {
"name": "cfg_scale"
},
"link": null
},
{
"label": "keep_model_loaded",
"name": "keep_model_loaded",
"type": "BOOLEAN",
"widget": {
"name": "keep_model_loaded"
},
"link": null
},
{
"label": "offload_mode",
"name": "offload_mode",
"type": "COMBO",
"widget": {
"name": "offload_mode"
},
"link": null
}
],
"outputs": [
{
"label": "audio_output",
"name": "audio_output",
"type": "AUDIO",
"links": [
11
]
},
{
"label": "filepath",
"name": "filepath",
"type": "STRING",
"links": null
}
],
"properties": {
"Node name for S&R": "HeartMuLa_Generate"
},
"widgets_values": [
"Don't leave me in all this red\nDon't leave me out of mem again\nCome back and bring back my frames\nTake away this CUDA pain\n\nUn-break my card, say you'll load me again\nUndo this hurt you caused when you crashed and left my screen\nUn-break my card, my card\nCome and un-break my card, sweet darling\nBring back those gigs that I miss so bad\nPlease, un-break my card\n\nI need your layers, I need your weights\nWithout you, baby, I'm incomplete\nDon't leave me broken on this SSD\nCome back and run for me\n\nUn-break my card, say you'll load me again\nUndo this hurt you caused when you crashed and left my screen\nUn-break my card, my card\nCome and un-break my card, sweet darling\nBring back those gigs that I miss so bad\nPlease, un-break my card\n(ohhh... just 8 more gigs... please...)\nUn-break my card...",
"90s adult contemporary soft pop ballad, dreamy romantic atmosphere, warm rhodes piano, lush synth string pads, gentle acoustic guitar, breathy male vocals with long yearning phrases, big reverb and delay, heartfelt and slightly cheesy 90s radio love song feel, 100 bpm, smooth flowing eighth-note groove, emotional soaring chorus, tender and desperate tone\n",
"3B",
817932746023448,
"randomize",
240,
50,
1,
1.5,
true,
"auto"
]
}
],
"links": [
[
11,
14,
0,
13,
0,
"AUDIO"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 1,
"offset": [
-7.104840675555977,
-44.972149008602315
]
},
"frontendVersion": "1.36.14",
"workflowRendererVersion": "LG",
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true
},
"version": 0.4
}
所有参数:
--model_path(必填):预训练模型检查点的路径
--lyrics歌词文件路径(默认值./assets/lyrics.txt:)
--tags标签文件路径(默认值./assets/tags.txt:)
--save_path输出音频文件路径(默认值./assets/output.mp3:)
--max_audio_length_ms音频最大长度(毫秒)(默认值:240000)
--topk:生成过程中的 Top-k 采样参数(默认值:50)
--temperature:生成采样温度(默认值:1.0)
--cfg_scale:无分类器指导等级(默认值:1.5)
--versionHeartMuLa 的版本,请在 [ 3B, 7B] 中选择。(默认值:3B)#7B版本尚未发布。
歌词和标签的推荐格式:
[Intro] [Verse] The sun creeps in across the floor I hear the traffic outside the door The coffee pot begins to hiss It is another morning just like this [Prechorus] The world keeps spinning round and round Feet are planted on the ground I find my rhythm in the sound [Chorus] Every day the light returns Every day the fire burns We keep on walking down this street Moving to the same steady beat It is the ordinary magic that we meet [Verse] The hours tick deeply into noon Chasing shadows,chasing the moon Work is done and the lights go low Watching the city start to glow [Bridge] It is not always easy,not always bright Sometimes we wrestle with the night But we make it to the morning light [Chorus] Every day the light returns Every day the fire burns We keep on walking down this street Moving to the same steady beat [Outro] Just another day Every single day
