MiniMax Music Generation
A Full Song From a Prompt and a Lyric Sheet
- audio_path
- audio_url
The MiniMax Music Generation node is the pack's hidden weapon. Hidden because - heads up - the README never mentions it. The pack's docs only cover the speech and video nodes, but the code ships a full music generator that sits in your node menu under JM-MiniMax-API/Music. This article is basically the documentation it never got.
What it does: you give it a description of a song and a lyric sheet, and MiniMax's music-1.5 model composes an actual audio track with vocals. No local model, no GPU, no training - your description and lyrics go up to MiniMax's cloud and a rendered song comes back down.
How it works
The node POSTs to https://api.minimax.io/v1/music_generation with your prompt, lyrics, and an audio_setting block (sample rate, bitrate, format). Note the host: api.minimax.io, not the api.minimaxi.chat that the TTS and video nodes in this same pack use. The response carries the audio as either hex-encoded data (the default output_format: hex) or a download URL. The node decodes the hex, or downloads from the URL, and writes a timestamped file to your ComfyUI output folder.
Worth knowing: the API may report the track as still generating (status: 1) but return the audio anyway - the node logs that and saves what it got.
The inputs that matter
- prompt - the musical description: style, mood, scene. Required, 10–300 characters. The defaults and examples lean Chinese ("流行音乐, 难过, 适合在下雨的晚上" - pop, sad, fits a rainy evening), and MiniMax's models genuinely do best when you describe them in Chinese. English works, but don't fight the model's home language.
- lyrics - the actual song words, 10–600 characters. Split lines with
\nand use structure tags like[Intro],[Verse],[Chorus]to give the model a roadmap. - model - currently just
music-1.5, so you won't be choosing much here. - filename_prefix - output filename prefix, default
music_output.
The optional stuff is where the control lives:
- format -
mp3,wav, orpcm(default mp3). - sample_rate - 16000/24000/32000/44100 Hz (default 44100).
- bitrate - 32000–256000 bps (default 256000).
- output_format -
hexorurl. Inurlmode the audio comes back as a download link valid for 24 hours. - stream - streaming mode, which only works with
output_format: hex; the node refuses the combination otherwise. - aigc_watermark - appends an AI-generated-content watermark to the end of the track. Turn it on if you're posting anywhere that cares about disclosure.
Outputs
Two strings: audio_path (the absolute path to the saved file - wire this into Preview Audio or an audio saver) and audio_url (the MiniMax-hosted URL, which is only populated in url mode and is your shareable link).
Common issues
Both prompt and lyrics have hard minimum lengths (10 characters), and the node validates them up front - too-short lyrics is the most common first-run mistake. Also, before you assume the API is broken, check the response logs: the node prints music metadata (duration, sample rate, bitrate) that's genuinely useful for judging whether the render is sane.
Install
Part of the ComfyUI-JM-MiniMax-API pack:
cd ComfyUI/custom_nodes
git clone https://github.com/synthetai/ComfyUI-JM-MiniMax-API
pip install -r requirements.txt
Or search "ComfyUI-JM-MiniMax-API" in ComfyUI Manager, then restart. Dependencies are just requests and Pillow. You'll need a MiniMax API key from their open platform - and yes, this is a paid cloud call, so every song costs you a few cents of API credit.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| prompt | STRING | 音乐的描述,用于指定风格、情绪和场景。长度限制为10-300个字符 | |
| lyrics | STRING | 歌曲的歌词,使用\n分隔每行。长度限制为10-600个字符 | |
| model | COMBO | music-1.5 | 1 options: music-1.5 |
| filename_prefix | STRING | music_output | — |
| streamopt | BOOLEAN | false | 是否使用流式传输 |
| output_formatopt | COMBO | hex | hex: 返回十六进制编码的音频数据; url: 返回音频下载链接(有效期24小时) |
| sample_rateopt | COMBO | 44100 | 4 options: 16000, 24000, 32000, 44100 |
| bitrateopt | COMBO | 256000 | 4 options: 32000, 64000, 128000, 256000 |
| formatopt | COMBO | mp3 | 3 options: mp3, wav, pcm |
| aigc_watermarkopt | BOOLEAN | false | 是否在音频末尾添加水印 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| audio_path | STRING | — |
| audio_url | STRING | — |