MiniMax · HF

MiniMax-Music3

MiniMax-Music3

二〇二六年八月二十六日 · 英文原文

MiniMax发布Music 3音乐生成模型,支持生成最长五分钟的完整歌曲,输出32 kHz、16位立体声WAV音频。模型采用8B Global LLM与0.6B Local LLM的Hybrid-LM分层架构,结合Flow Matching与Flow-VAE连续隐状态合成系统,支持歌词与结构化音乐描述(含全局元数据、人声细节、编曲)的细粒度控制。模型已开源,支持SGLang、diffusers及ComfyUI推理框架。

MiniMax Music 3

MiniMax Music 3 是一个高性能音乐生成模型,用于创作最长五分钟的完整歌曲。以歌词和详细的音乐描述为条件,它能生成结构连贯的歌曲,包含富有表现力的人声、渐进的编曲和稳定的长音频质量。

MiniMax Music 3 结合了用于长程音乐结构的 8B Global LLM、用于帧级声学细节的 0.6B Local LLM,以及基于 Flow MatchingFlow-VAE 的连续隐状态合成系统。该模型输出 32 kHz、16 位立体声 WAV 音频。

演示

MiniMax Music 3 Demo 上探索音乐生成示例。

具有长程连贯性的完整歌曲

MiniMax Music 3 原生支持最长五分钟的完整歌曲生成。模型能在长序列中保持音乐主题、节奏、人声特征和编曲推进,从而支持完整的结构,如前奏、主歌、导歌、副歌、桥段、器乐间奏和尾奏。

细粒度音乐控制

模型接受两种互补输入:

为实现精确控制,我们建议使用包含三个部分的 Structured Caption:

这种表示方式使模型不仅能遵循全局风格,还能跟随歌曲随时间的音乐发展。

Hybrid-LM

MiniMax Music 3 采用分层自回归架构,将全局音乐建模与局部声学建模分离。

Global LLM 从 Qwen3-8B 初始化。训练期间,其 embedding 和输出层首先适配语义音乐 token。随后,Global 和 Local LLM 联合训练,以建模所有 RVQ codebook。

连续隐状态合成

合成模块并非仅从离散 RVQ token 解码,而是融合 Global 和 Local LLM 的最终隐状态。这些连续表示保留了更丰富的声学信息,用于人声发音、乐器质感和时间连续性。

合成路径如下:

Global 和 Local LLM 隐状态
                ↓
       隐状态融合
                ↓
     Flow Matching (2.4B)
                ↓
        Flow-VAE latent
                ↓
    Flow-VAE Decoder (123M)
                ↓
       32 kHz 立体声音频

Flow-VAE 架构改编自 MiniMax Speech,并针对音乐的动态范围和频谱特性进行了重新训练。

音乐 Tokenizer

训练 tokenizer 使用八层残差向量量化(RVQ):

训练首先优化语义 codebook,然后联合训练全部八个 codebook。推理时,波形合成使用融合后的 LLM 隐状态,无需离散 tokenizer 解码器。

使用方法

MiniMax Music 3 由 SGLang-Omni 支持。请按照官方安装指南准备运行环境。

下载模型

hf download MiniMaxAI/MiniMax-Music3 --local-dir /path/to/minimax_ttm

我们推荐以下推理框架来服务该模型:

使用 SGLang-Omni 服务

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.wav

max_new_tokens 设置最大音频帧数,每秒 25 帧。当模型发出音频结束 token 时,生成可能在此限制之前完成。响应为 32 kHz、16 位立体声 WAV 文件。

可复现示例

以下端到端示例包含用于生成参考音频的完整歌词、音乐描述和生成参数。

用例 请求 结果
文生音乐 查看脚本 minimax_ttm.wav

🧨 Diffusers

MiniMax Music 3 可作为 diffusers 模块化 pipeline 使用。在 huggingface/diffusers#14456 合并之前,请从该 PR 的提交安装 diffusers:

以下代码片段适用于 24GB 及以上显存的 GPU

pip install git+https://github.com/huggingface/diffusers@dafe3733fcfdbf3c48915fe77be3aef65b5d6a2d transformers accelerate soundfile
import 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 offloading 后,生成约占用 22 GB;进一步逐层流式加载语言模型,甚至可适配 8 GB 显卡:

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)

# 仅需在约 22 GB 以下显存时使用 — 较慢,但可适配 8 GB。
apply_group_offloading(
    pipe.language_model, onload_device=torch.device("cuda"), offload_type="leaf_level", use_stream=True
)

提示增强

可直接使用简洁的自然语言描述。如需更丰富的提示和更精确的控制,可使用提供的 music-caption-rewriter 技能将其扩展为包含 Global MetadataVocal DetailsArrangement 的 Structured Caption。该技能会在编曲描述中保留附加到歌词段落标签的音乐指令,同时将歌词文本保留在歌词输入中。

npx skills add MiniMax-AI/MiniMax-Music3 --skill music-caption-rewriter

局限性

联系我们

请通过 model@minimax.io 联系我们。

译自 MiniMax · HF · 录于 二〇二六年八月二十六日