Nodes/ComfyUI-JM-MiniMax-API/MiniMax Music Generation
ComfyUI Node

MiniMax Music Generation

A Full Song From a Prompt and a Lyric Sheet

By juemingai·Created about a year ago·Updated about a year ago· 6
MiniMax Music Generation
    • audio_path
    • audio_url
    api_key
    prompt
    lyrics
    modelmusic-1.5
    filename_prefixmusic_output
    streamfalse
    output_formathex
    sample_rate44100
    bitrate256000
    formatmp3
    aigc_watermarkfalse

    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 \n and 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, or pcm (default mp3).
    • sample_rate - 16000/24000/32000/44100 Hz (default 44100).
    • bitrate - 32000–256000 bps (default 256000).
    • output_format - hex or url. In url mode 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.

    CategoryJM-MiniMax-API/Music

    Inputs (11)

    NameTypeDefaultDescription
    api_keySTRING
    promptSTRING音乐的描述,用于指定风格、情绪和场景。长度限制为10-300个字符
    lyricsSTRING歌曲的歌词,使用\n分隔每行。长度限制为10-600个字符
    modelCOMBOmusic-1.51 options: music-1.5
    filename_prefixSTRINGmusic_output
    streamoptBOOLEANfalse是否使用流式传输
    output_formatoptCOMBOhexhex: 返回十六进制编码的音频数据; url: 返回音频下载链接(有效期24小时)
    sample_rateoptCOMBO441004 options: 16000, 24000, 32000, 44100
    bitrateoptCOMBO2560004 options: 32000, 64000, 128000, 256000
    formatoptCOMBOmp33 options: mp3, wav, pcm
    aigc_watermarkoptBOOLEANfalse是否在音频末尾添加水印

    Outputs (2)

    NameTypeDescription
    audio_pathSTRING
    audio_urlSTRING