opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

Demucs v4 brings Hybrid Transformer separation to music source splits.
GitHub RepoImpressions2

Project Description

View on GitHub

Demucs v4: Splitting Music into Stems with Hybrid Transformer Separation

You've got a song and you need just the vocals. Or maybe you want to isolate the bassline to learn it, or pull the drums out for a remix. Manual audio editing for this is painful, and most commercial tools are either expensive or locked down. Demucs v4 is an open-source answer: a state-of-the-art music source separation model that can split any track into drums, bass, vocals, and the remaining accompaniment.

This is the fourth major release of Demucs, now officially maintained by Alexandre Défossez (who has moved on to Kyutai Labs). It's a significant upgrade over previous versions, swapping the core architecture for something called Hybrid Transformer Demucs (htdemucs). If you've used Demucs v3 before, this is a major step forward. If you haven't, this is the version to start with.

What It Does

Demucs is a deep learning model for music source separation. You feed it an audio file, and it outputs four separate stems: drums, bass, vocals, and "other" (the remaining accompaniment). The architecture is a U-Net convolutional network, inspired by Wave-U-Net, but v4 takes a hybrid approach.

The model works on both spectrograms and raw waveforms simultaneously—hence "hybrid." The innermost layers of the network are replaced with a cross-domain Transformer Encoder. This Transformer uses self-attention within each domain (spectral and temporal) and cross-attention across them. That's the key innovation: the model can reason about patterns in both representations and share information between them.

The results are strong. On the MUSDB HQ test set, the model achieves a Signal-to-Distortion Ratio (SDR) of 9.00 dB. With sparse attention kernels and per-source fine-tuning, that jumps to 9.20 dB, which is state-of-the-art. It was trained on MUSDB HQ plus an additional 800 songs. The default model is htdemucs_ft (the fine-tuned version), but you can also use the non-fine-tuned htdemucs or the retrained v3 baseline hdemucs_mmi.

There's also an experimental 6-source model that adds guitar and piano stems. Fair warning from the README: guitar quality is okay, but piano has "a lot of bleeding and artifacts." It's a fun experiment, but don't expect production quality on those extra stems yet.

Why It's Cool

The architecture is genuinely clever. Combining spectrogram and waveform processing isn't new, but the cross-domain Transformer is a neat twist. Instead of just concatenating features, the model lets each domain attend to the other. That's a thoughtful design choice that directly addresses the limitations of single-domain models.

It's practical out of the box. You don't need to train anything. The pre-trained models are ready to go, and the fine-tuned version is the default. You can separate a song with a single command. That's the kind of frictionless experience that makes a tool actually usable.

It's a major version bump with real improvements. The README makes clear this isn't just a polish release. The v4 models are a new architecture, not a retrained version of v3. If you've been using Demucs, upgrading gives you a measurable quality boost (9.00 dB vs. whatever you were getting before). If you're new, you're starting at the top.

The project is honest about its limitations. The README openly states that the main maintainer isn't actively working on it anymore, that replies will be slow, and that the sparse attention kernels (which would improve quality further) aren't released because they require custom CUDA code. That's refreshing. It sets expectations clearly and tells you exactly what you're getting.

It has a clear lineage. The README links back to v3 and v2, so you can explore the history if you're curious. And if you hit issues with v4, you can git checkout v3 to get the old version back. That's good project hygiene.

How to Try It

First, install Demucs. It's on PyPI, so a simple pip install works:

pip install demucs

Then, separate a track. The basic command is:

demucs path/to/your/song.mp3

This will use the default htdemucs_ft model (the fine-tuned Hybrid Transformer). You'll get four stems in the output directory: drums.wav, bass.wav, vocals.wav, and other.wav.

If you want to try the non-fine-tuned model or the v3 baseline:

demucs -n htdemucs path/to/your/song.mp3
demucs -n hdemucs_mmi path/to/your/song.mp3

And if you're feeling adventurous, the 6-source model:

demucs -n htdemucs_6s path/to/your/song.mp3

Just remember the piano stem might be rough.

For more details, including the SDX 2023 Challenge support and the torchaudio implementation, check out the repository on GitHub. You can also listen to sample outputs on the paper's sample page to get a sense of the quality before you run it yourself.

Final Thoughts

Demucs v4 is a solid, practical tool for anyone working with music—producers, remixers, musicians learning parts, or developers building audio applications. The Hybrid Transformer architecture delivers state-of-the-art separation quality, and the pre-trained models mean you can start using it immediately. It's not without caveats: the maintainer has stepped back, the experimental 6-source model is rough around the edges, and the best version of the architecture (sparse attention) isn't publicly available. But the core product is excellent and free. If you've got a song you've always wanted to deconstruct, this is the easiest way to do it.


Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: 17365384-4ece-4aea-812f-1787d1f5a12fLast updated: August 25, 2026 at 02:46 AM