Text-to-Audio
Diffusers
Safetensors
PyTorch
minimax_music3
music-generation
text-to-music
sglang-omni
Run this model with HF Jobs
Run MiniMaxAI/MiniMax-Music3 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/MiniMaxAI/MiniMax-Music3. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/MiniMaxAI/MiniMax-Music3 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use MiniMaxAI/MiniMax-Music3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use MiniMaxAI/MiniMax-Music3 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("MiniMaxAI/MiniMax-Music3", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Add diffusers usage section to the README
#3
by MiniMax-AI - opened
142 unmodified lines143144145146147148142 unmodified lines|---|---|---|| Text-to-music | [View script](https://huggingface.co/MiniMaxAI/MiniMax-Music3/blob/main/scripts/end_to_end/minimax_ttm_test.py) | [minimax_ttm.wav](https://huggingface.co/MiniMaxAI/MiniMax-Music3/blob/main/assets/minimax_ttm.wav) |## Prompt EnhancementA concise natural-language description can be used directly. For richer prompts and more precise control, use the provided [`music-caption-rewriter`](skills/music-caption-rewriter/SKILL.md) skill to expand it into a Structured Caption containing `Global Metadata`, `Vocal Details`, and `Arrangement`. The skill preserves musical instructions attached to lyric section tags in the arrangement description while keeping the lyric text in the lyrics input.142 unmodified lines143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212142 unmodified lines|---|---|---|| Text-to-music | [View script](https://huggingface.co/MiniMaxAI/MiniMax-Music3/blob/main/scripts/end_to_end/minimax_ttm_test.py) | [minimax_ttm.wav](https://huggingface.co/MiniMaxAI/MiniMax-Music3/blob/main/assets/minimax_ttm.wav) |## 🧨 DiffusersMiniMax Music 3 is available as a [diffusers](https://github.com/huggingface/diffusers) modular pipeline. Until [huggingface/diffusers#14456](https://github.com/huggingface/diffusers/pull/14456) is merged, install diffusers from the PR commit:The snippet below fits 24GB+ VRAM GPUs```bashpip install git+https://github.com/huggingface/diffusers@dafe3733fcfdbf3c48915fe77be3aef65b5d6a2d transformers accelerate soundfile``````pythonimport soundfile as sfimport torchfrom diffusers import ModularPipelinepipe = ModularPipeline.from_pretrained("MiniMaxAI/MiniMax-Music3")pipe.load_components(dtype=torch.bfloat16)pipe.to("cuda")lyrics = """[verse]Morning light filtering through the pineEvery 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)```### Low VRAMThe full precision fits under 24GB of VRAM. With automatic CPU offloading, generation takes in ~22 GB; additionally streaming the language model layer by layer makes it fit even 8 GB video cards:```pythonimport torchfrom diffusers import ComponentsManager, ModularPipelinefrom diffusers.hooks import apply_group_offloadingmanager = 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)```## Prompt EnhancementA concise natural-language description can be used directly. For richer prompts and more precise control, use the provided [`music-caption-rewriter`](skills/music-caption-rewriter/SKILL.md) skill to expand it into a Structured Caption containing `Global Metadata`, `Vocal Details`, and `Arrangement`. The skill preserves musical instructions attached to lyric section tags in the arrangement description while keeping the lyric text in the lyrics input.
README.md+64