MiniMax Music 3 是一款高性能音乐生成模型,能够创作最长五分钟的完整歌曲。以歌词和详细的音乐描述为条件输入,该模型可生成结构连贯的歌曲,包含富有表现力的人声、循序渐进的编曲变化,以及稳定的长篇幅音频质量。
MiniMax Music 3 融合了用于捕捉长程音乐结构的 8B 全局语言模型、负责帧级声学细节的 0.6B 局部语言模型,以及基于 Flow Matching 和 Flow-VAE 的连续隐状态合成系统。该模型可输出 32 kHz、16 位立体声 WAV 音频。
在 MiniMax Music 3 演示页面 上探索音乐生成示例。
MiniMax Music 3 原生支持长达五分钟的完整歌曲生成。该模型能够在长序列中保持音乐主题、节奏、人声特质和编曲推进,从而支持完整歌曲结构,如前奏、主歌、预副歌、副歌、桥段、器乐间奏和尾奏。
该模型接受两种互补的输入:
[Intro]、[Verse]、[Pre-Chorus]、[Chorus]、[Post-Chorus]、[Bridge]、[Instrumental]、[Solo] 和 [Outro]。为实现精确控制,我们建议使用包含三个部分的结构化描述:
这种表示方式使模型不仅能遵循整体风格,还能跟随歌曲随时间的音乐发展脉络。
MiniMax Music 3 采用分层自回归架构,将全局音乐建模与局部声学建模相分离。
全局大语言模型以 Qwen3-8B 为初始化基础。在训练过程中,其嵌入层和输出层首先适配为语义音乐令牌,随后全局与局部大语言模型进行联合训练,以对所有 RVQ 码本进行建模。
合成模块并非仅从离散的 RVQ 令牌进行解码,而是融合全局与局部大语言模型的最终隐状态。这些连续表示保留了更丰富的声学信息,涵盖人声发音、乐器质感与时间连续性。
合成路径如下:
Global and Local LLM hidden states
↓
Hidden-state fusion
↓
Flow Matching (2.4B)
↓
Flow-VAE latent
↓
Flow-VAE Decoder (123M)
↓
32 kHz stereo audioFlow-VAE 架构源自 MiniMax Speech,并针对音乐的动态范围与频谱特性进行了重新训练。
训练所用的分词器采用八层残差向量量化(RVQ):
训练过程首先优化语义码本,随后对全部八个码本进行联合训练。在推理阶段,波形合成使用融合后的 LLM 隐状态,无需依赖离散分词器的解码器。
MiniMax Music 3 由 SGLang-Omni 提供支持。请按照官方安装指南准备运行环境。
hf download MiniMaxAI/MiniMax-Music3 --local-dir /path/to/minimax_ttm我们推荐使用以下推理框架来部署该模型:
sgl-omni serve --model-path MiniMaxAI/MiniMax-Music3 --port 8000该服务使用共享的语音API。将歌词放入input中,音乐描述放入instructions中。将歌词结构标签(如[Verse]和[Chorus])单独放在一行中。
curl http://127.0.0.1:8000/v1/audio/speech \
-H 'Content-Type: application/json' \
-d '{
"model": "MiniMaxAI/MiniMax-Music3",
"input": "[Verse]\nMorning light filtering through the pine\n[Chorus]\nSoftly the world begins to breathe",
"instructions": "A warm acoustic pop song with intimate female vocals, fingerpicked guitar, soft piano, and a gradual emotional build into a wide final chorus.",
"response_format": "wav",
"seed": 7,
"max_new_tokens": 750,
"stream": false
}' \
--output minimax_music3.wavmax_new_tokens 以每秒 25 帧的速率设置最大音频帧数。当模型生成结束音频标记时,生成可能会提前终止。响应结果为 32 kHz、16 位立体声 WAV 文件。
以下端到端示例包含了用于生成参考音频的完整歌词、音乐描述和生成参数。
| 使用场景 | 请求 | 结果 |
|---|---|---|
| 文生音乐 | 查看脚本 | minimax_ttm.wav |
MiniMax Music 3 以 diffusers 模块化流水线的形式提供。在 huggingface/diffusers#14456 合并之前,请从该 PR 提交安装 diffusers:
以下代码片段适用于 24GB 及以上显存的 GPU
pip install git+https://github.com/huggingface/diffusers@dafe3733fcfdbf3c48915fe77be3aef65b5d6a2d transformers accelerate soundfileimport soundfile as sf
import torch
from diffusers import ModularPipeline
pipe = ModularPipeline.from_pretrained("MiniMaxAI/MiniMax-Music3")
pipe.load_components(dtype=torch.bfloat16)
pipe.to("cuda")
lyrics = """[verse]
Morning light filtering through the pine
Every quiet street is yours and mine
[chorus]
Softly the world begins to breathe"""
prompt = (
"Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus. "
"Vocals: soft female lead, close and breathy, light stacked harmonies in the chorus. "
"Arrangement: fingerpicked guitar and soft piano; brushed drums and upright bass enter in the chorus."
)
audio = pipe(
prompt=prompt,
lyrics=lyrics,
audio_duration=60.0,
generator=torch.Generator("cuda").manual_seed(7),
output="audios",
)[0]
sf.write("song.wav", audio.T.float().cpu().numpy(), pipe.sampling_rate)完整精度下,显存需求可控制在24GB以内。启用自动CPU卸载后,生成过程约占用22GB显存;此外,通过逐层流式加载语言模型,甚至可在8GB显存的显卡上运行:
import torch
from diffusers import ComponentsManager, ModularPipeline
from diffusers.hooks import apply_group_offloading
manager = ComponentsManager()
manager.enable_auto_cpu_offload(device="cuda")
pipe = ModularPipeline.from_pretrained("MiniMaxAI/MiniMax-Music3", components_manager=manager)
pipe.load_components(dtype=torch.bfloat16)
# Only needed below ~22 GB of VRAM — slower, but fits in 8 GB.
apply_group_offloading(
pipe.language_model, onload_device=torch.device("cuda"), offload_type="leaf_level", use_stream=True
)
简洁的自然语言描述可直接使用。若需更丰富的提示词和更精确的控制,可使用提供的 music-caption-rewriter 技能,将其扩展为包含全局元数据、人声细节和编曲的结构化描述。该技能会保留编曲描述中附加在歌词段落标签上的音乐指令,同时将歌词文本保留在歌词输入中。
npx skills add MiniMax-AI/MiniMax-Music3 --skill music-caption-rewriter可通过 model@minimax.io 与我们取得联系。