HeartMuLa:一系列开源音乐基础模型
- HeartMuLa:一种音乐语言模型,可根据歌词和标签生成音乐,支持多种语言,包括但不限于英语、中文、日语、韩语和西班牙语。
- HeartCodec:一种具有高重建保真度的 12.5 Hz 音乐编解码器;
- HeartTranscriptor:一种基于耳语的模型,专门用于歌词转录;
- HeartCLAP:一种音频-文本对齐模型,为音乐描述和跨模态检索建立统一的嵌入空间。
必备环境
2、Python 3.10【点击下载】,这是官方推荐的版本
3、Conda【点击下载】 ,推荐安装MiniConda,更精简更适合,不会夹带臃肿的环境包,注意不要选最新的 3.13 ,它对AI项目的兼容性不是很好,建议选择3.10~3.12,安装后将其添加到系统环境下,否则无法正常使用!
必备环境打包完整版:【网盘下载】
测试是否正常安装
本地部署
1.git clone https://github.com/HeartMuLa/heartlib.git
4.conda create -n heartmula python=3.10 # 创建虚拟环境
7.conda activate heartmula# 激活并进入虚拟环境
2、使用以下命令从 huggingface下载预训练的模型、检查点,非海外人士记得挂全局 VPN 开启Tun模型!
在 heartlib 根目录下创建文件夹ckpt文件夹
1.hf download HeartMuLa/HeartMuLaGen –local-dir ./ckpt
4.hf download HeartMuLa/HeartMuLa-oss-3B –local-dir ./ckpt/HeartMuLa-oss-3B
7..hf download HeartMuLa/HeartCodec-oss –local-dir ./ckpt/HeartCodec-oss
下载完成后,./ckpt子文件夹结构应如下所示:
./ckpt/
├── HeartCodec-oss/
├── HeartMuLa-oss-3B/
├── gen_config.json
└── tokenizer.json
用法示例
python ./examples/run_music_generation.py –model_path=./ckpt –version=“3B”
默认情况下,此命令将根据文件夹中提供的歌词和标签生成一段音乐./assets。输出的音乐将保存在./assets/output.mp3.
--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版本尚未发布。
安装 triton模块:【点击下载】 或【网盘下载】,否则在生成的时候会报错提示模块没有加载!
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
The world keeps spinning round and round
Feet are planted on the ground
I find my rhythm in the sound
Every day the light returns
We keep on walking down this street
Moving to the same steady beat
It is the ordinary magic that we meet
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
It is not always easy,not always bright
Sometimes we wrestle with the night
But we make it to the morning light
Every day the light returns
We keep on walking down this street
Moving to the same steady beat
我们的不同标签之间用逗号分隔,不带空格,如下所示:
piano,happy,wedding,synthesizer,romantic
![图片[1]-Suno AI 最强开源替代来了!离线音乐生成,本地部署 + ComfyUI-小D研究所](https://www.freedidi.com/wp-content/uploads/2026/01/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2026-01-22-162247-scaled.webp)
当然我们还可以直接在 ComfyUI 里使用,更适合新手使用,因为有可视化的UI界面,操作会更加简单高效,到时需要用到这个 【自定义节点】【备用下载】它开源在GitHub社区的。
1、安装最新版 ComfyUI 【点击下载】
安装
步骤 1
转到 ComfyUI\custom_nodes 命令提示符:
git clone https://github.com/benjiyaya/HeartMuLa_ComfyUI
步骤 2
步骤 3
pip install -r requirements.txt
如果没有弹出模块名称错误提示,则某些库可能需要单独安装(Windows 用户需要以管理员身份使用命令提示符)。
执行以下命令:
前往 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 –local-dir ./HeartMuLa/HeartCodec-oss
hf download HeartMuLa/HeartTranscriptor-oss –local-dir ./HeartMuLa/HeartTranscriptor-oss
2、工作流下载:【点击前往】 或 【备用下载】
最后载入工作流即可在ComfyUI 里进行生成AI音乐了!
便携式音箱
![图片[2]-Suno AI 最强开源替代来了!离线音乐生成,本地部署 + ComfyUI-小D研究所](https://www.freedidi.com/wp-content/uploads/2026/01/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2026-01-22-023759-scaled.webp)
本文转自零度解说
暂无评论内容