MusicGen
Generates instrumental music from a text description with Meta's MusicGen Large. A token budget sets clip length, about 20 seconds at the default, and guidance sets how closely it follows the prompt.
Overview
Meta released MusicGen in 300M, 1.5B and 3.3B sizes; this page runs the 3.3B Large checkpoint. A single-stage autoregressive Transformer predicts EnCodec audio tokens (32 kHz, four codebooks at 50 Hz) that are decoded into a waveform. The training set was 20,000 hours of licensed music with the vocals stripped out, so the output is instrumental.
What you can build
The license is non-commercial (see below), so think research and personal projects:
- Prompting studies, such as how tempo or instrument words change a clip at fixed guidance.
- Placeholder scores for game jams and student films.
- Classroom demos of how wording changes genre and instrumentation.
Inputs
Describe the music in English: genre, instruments, mood, tempo. The default asks for a slow, wistful piano piece; another suggestion on the page is "90s rock song with electric guitar and heavy drums".
Tokens (0 to 2048, default 1024) is the generation budget. At about 50 tokens per second of audio, the default returns roughly 20 seconds. Guidance scale (1 to 20, default 3) weighs the prompt against an unconditioned pass, and 1 switches guidance off.
Outputs
One mono 32 kHz MP3 per run. The page samples pair a prompt with its clip: the default piano prompt gives about 20 seconds, the acoustic country prompt a shorter piece.
Recommended settings
Stay at guidance 3, the value the Transformers documentation recommends; higher values follow the prompt more closely, usually with poorer audio. Keep Tokens at 1503 or below although the field goes to 2048. The Transformers documentation puts MusicGen's limit at 30 seconds of audio (1503 tokens), set by its positional embeddings. Larger values still return longer clips, but nothing in that documentation covers quality past that point.
Limitations
From Meta's model card:
- No realistic vocals.
- Trained on English descriptions; other languages do worse.
- Uneven quality across music styles and cultures.
- Songs sometimes end by collapsing into silence.
- Good results can take prompt engineering.
Safety & compliance
The weights are licensed CC-BY-NC 4.0, and Meta names research on AI-based music generation as the primary use. The card rules out downstream applications without further risk evaluation and mitigation, and deliberately making music that creates hostile or alienating environments or spreads stereotypes.
Example prompts
Great starting points for music_gen.
API quick start
Run music_gen with a single API call.
{
"prompt": "Sad and longing. The melody is slow and w…",
"tokens": 1024,
"scale": 3
}curl -X POST "https://api.wiro.ai/v1/Run/wiro/music-gen" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_WIRO_API_KEY" \
--data-binary @- <<'JSON'
{
"prompt": "Sad and longing. The melody is slow and w…",
"tokens": 1024,
"scale": 3
}
JSONOther models you might like
Explore similar music generation models.



