MAGNeT
Meta’s non-autoregressive masked transformer for text-to-music and text-to-sound — much faster than MusicGen.
| Language | Python |
|---|---|
| Category | ML & generative |
| License | MIT (code) · CC-BY-NC-4.0 (weights) |
| Platforms | Linux Windows macOS |
| Install | pip install audiocraft |
| First released | 2024 |
| Maintained | Limited |
| Links | Docs · Source · Paper |
Strengths
- Non-autoregressive — generates in a fixed number of steps rather than token by token, so it is far faster than MusicGen
- Single-stage: no semantic conditioning, model cascading or audio prompting required
- Both music and sound-effect checkpoints, at 10 and 30 seconds
- Same AudioCraft API as MusicGen and AudioGen
Limitations
- Non-commercial weights (CC-BY-NC-4.0)
- Fixed output lengths per checkpoint — pick 10 s or 30 s at load time
- Quality generally trails MusicGen at the same size; speed is the trade
- Less widely used, so fewer worked examples exist
Best for
Iterating quickly on text-to-audio ideas, or any workflow where MusicGen’s sequential generation is the bottleneck.
Minimal example
from audiocraft.models import MAGNeT
from audiocraft.data.audio import audio_write
model = MAGNeT.get_pretrained('facebook/magnet-small-10secs')
wav = model.generate(['80s electronic track with melodic synthesizers'])
audio_write('magnet_out', wav[0].cpu(), model.sample_rate, strategy='loudness')
Checkpoints
| Checkpoint | Size | Output |
|---|---|---|
| facebook/magnet-small-10secs | 300M | Music, 10 s |
| facebook/magnet-medium-10secs | 1.5B | Music, 10 s |
| facebook/magnet-small-30secs | 300M | Music, 30 s |
| facebook/magnet-medium-30secs | 1.5B | Music, 30 s |
| facebook/audio-magnet-small | 300M | Sound effects |
| facebook/audio-magnet-medium | 1.5B | Sound effects |
Related tools
See all MAGNeT alternatives & how they compare →
See the whole ML & generative category →