Demucs: Meta's AI-Powered Music Source Separation — Split Any Song into Stems
Demucs uses Meta's HTDemucs v4 hybrid transformer to split songs into vocals, drums, bass, and other stems. Complete guide to the best open-source separator.
What Is Demucs?
Demucs is Meta's state-of-the-art music source separation tool. With over 10,000 GitHub stars, it uses a hybrid spectrogram and waveform deep learning model (Hybrid Transformer Demucs v4) to split any mixed audio track into individual stems — vocals, drums, bass, and other instruments — with remarkable quality.
Developed by Meta FAIR (Facebook AI Research), Demucs has evolved through four major versions. The latest Demucs v4 (HTDemucs) achieves the best separation quality in open-source, rivaling commercial solutions like Spleeter and iZotope RX. It's widely used by musicians, DJs, remixers, and content creators to create karaoke tracks, isolate vocals for sampling, and remix songs.
🚀 Want to deploy Demucs yourself?
Docker configs, system requirements, and installation guides — all on one page.
View Demucs Tool Page →Why Demucs Dominates Music Separation
1. Hybrid Transformer Architecture (HTDemucs v4)
Demucs v4 uses a hybrid architecture that combines spectrogram-based frequency domain processing with waveform-based time domain processing. This dual approach captures both fine frequency details (important for separating overlapping instruments) and precise time structure (important for transient sounds like drums). The result is cleaner separation with fewer artifacts than pure spectrogram or pure waveform approaches.
2. Four-Stem Output
Demucs separates audio into four tracks: vocals, drums, bass, and other instruments. This 4-stem separation covers the most useful categories for remixing, karaoke creation, and music production. The "other" stem includes everything like guitars, keyboards, strings, and synths that don't fit into the first three categories.
3. GPU-Accelerated Processing
On a GPU, Demucs processes a 3-minute song in under 30 seconds — fast enough for interactive use. On CPU, it's slower (2-5 minutes per song) but still usable for batch processing. The v4 model is also more efficient than v3, requiring less memory while producing better quality.
4. Batch Processing
Demucs supports processing entire folders of audio files with a single command. Point it at a directory of MP3s and it'll separate every track, organizing each song into its own output folder with individual stem files.
5. MP4 and Video Support
Demucs can process video files directly, extracting the audio track, separating it, and optionally saving stems as separate audio files. This is perfect for YouTubers and video editors who need to isolate vocals from video clips.
Getting Started
Installation
pip install -U demucs
# Or clone for the latest:
git clone https://github.com/facebookresearch/demucs
cd demucs
pip install -e .
Basic Usage — CLI
# Separate a song into 4 stems
demucs song.mp3
# Output: separated/htdemucs/song/
# - vocals.wav
# - drums.wav
# - bass.wav
# - other.wav
Python API
import torch
import demucs.separator
from demucs import pretrained
# Load model
model = pretrained.get_model("htdemucs")
model.cuda()
# Separate audio
separator = demucs.separator.Separator(model)
sources = separator.separate_file("song.mp3")
# Access stems
vocals = sources["vocals"] # shape: (channels, samples)
drums = sources["drums"]
bass = sources["bass"]
other = sources["other"]
# Save stems
from demucs.audio import AudioFile
AudioFile.save("vocals.wav", vocals.cpu(), model.samplerate)
Self-Hosting with Docker
docker pull joanfont/demucs:latest
docker run -d \
--name demucs \
--gpus all \
-v ./input:/input \
-v ./output:/output \
joanfont/demucs:latest
Separate via Docker
docker exec demucs demucs /input/song.mp3 -o /output
Demucs vs Other Separators
| Feature | Demucs | Spleeter | Open-Unmix |
|---|---|---|---|
| Quality (v4) | ★★★★★ | ★★★☆☆ | ★★★★☆ |
| Stems | 4 (vocals/drums/bass/other) | 2, 4, or 5 | 4 |
| Speed (GPU, 3min song) | ~20s | ~10s | ~30s |
| Video input | ✅ | ❌ | ❌ |
| Batch processing | ✅ | ✅ | ✅ |
| Model versions | 4 (v1-v4) | 2 | 1 |
Best Use Cases
Karaoke Creation
Remove vocals from songs to create instrumental karaoke tracks. Just separate and discard the vocals stem.
Sampling & Remixing
Isolate individual elements from existing songs — grab the drum track from one song, the bassline from another, and create something new.
Music Analysis
Analyze the structure of songs by examining separated stems. See how the drums, bass, and vocals interact throughout a track.
Audio Restoration
Separate audio to apply different processing to different elements — de-noise only the vocals while keeping the music untouched.
Tips for Best Results
- Use
--two_stems=vocalsto export only vocal and no-vocal stems (faster) - Use the
htdemucsmodel — it's the best quality model (v4) - Use
--mp3flag to save stems as MP3 instead of WAV to save space - Use
--shifts=5for higher quality (averages multiple predictions, ~2x slower) - For GPU acceleration — ensure
torch.cuda.is_available()returns True
Conclusion
Demucs is the gold standard for open-source music source separation. Meta FAIR's HTDemucs v4 delivers separation quality that rivals commercial tools, at no cost, with full GPU acceleration. Whether you're making karaoke tracks, pulling samples for hip-hop beats, or analyzing music structure, Demucs is the tool for the job.
🚀 Explore Demucs on Run This Ai
Docker Compose configs, system requirements, installation guides, and more — all in one place.
View Demucs Tool Page →