StemSplitio/htdemucs-ft-drums-pytorch
HT-Demucs FT — Drums Specialist (PyTorch)
Drum isolation specialist from HT-Demucs FT, ~1/4 the size of the full ensemble.
This is sub-model 0 of the 4-bag htdemucs_ft ensemble by [Défossez et al. (Meta AI)][demucs-repo], extracted as a standalone ~160 MB model. It produces the drums stem with the same quality as the full ensemble (median SDR 10.11 dB on MUSDB18-HQ — 2nd (close behind mdxextraq at 11.49) of all models in our 2026 benchmark) at roughly 1/4 the compute cost.
Want all 4 stems in one request? Use the full ensemble: `StemSplitio/htdemucs-ft-pytorch` Want a hosted REST API with credits and a dashboard? Use the **StemSplit API**.
Why this model
If you only need the drums stem in production, this is strictly faster and smaller than the full ensemble with identical drums quality — ~2.6× faster wall time in our smoke tests on M4 Pro MPS.
Common use cases
- Drum sample extraction — rip clean drum loops and one-shots from existing tracks
- Beat transcription / MIDI — feed the drum stem to onset/beat detectors and drum transcribers
- Music production isolation — rebalance or replace drum bus on existing mixes
- Sample-pack generation — automate drum-pack creation from a back-catalogue
Quick start (Python)
import base64, io, soundfile as sf
from huggingface_hub import InferenceClient
with open("your-song.mp3", "rb") as f:
audio_b64 = base64.b64encode(f.read()).decode()
client = InferenceClient(model="StemSplitio/htdemucs-ft-drums-pytorch")
result = client.post(json={"inputs": audio_b64})
wav, sr = sf.read(io.BytesIO(base64.b64decode(result["drums"])))
sf.write("out_drums.wav", wav, sr)Or run locally without Hugging Face at all:
import torch, soundfile as sf
from demucs.apply import apply_model
from demucs.audio import convert_audio
from demucs.pretrained import get_model
bag = get_model("htdemucs_ft")
model = bag.models[0].eval() # the drums specialist
wav, sr = sf.read("your-song.mp3", dtype="float32", always_2d=True)
wav = torch.from_numpy(wav.T).contiguous()
wav = convert_audio(wav, sr, bag.samplerate, bag.audio_channels).unsqueeze(0)
with torch.no_grad():
stems = apply_model(model, wav, device="mps" if torch.backends.mps.is_available() else "cpu")[0]
# bag.sources == ["drums", "bass", "other", "vocals"]; pick the drums row
sf.write("out_drums.wav", stems[bag.sources.index("drums")].T.numpy(), bag.samplerate)Deploy on Hugging Face Inference Endpoints
Click Deploy → Inference Endpoints above, pick a GPU instance, and HF will spin up a container running `handler.py`.
(Roughly 2.6× faster than the full-bag latency, since we run only this specialist sub-model. Cloud GPU numbers extrapolated from M4 Pro measurements.)
curl -X POST https://<your-endpoint>.endpoints.huggingface.cloud \
-H "Authorization: Bearer $HF_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"inputs\": \"$(base64 < your-song.mp3)\"}"Try it in your browser, no code
Related models from StemSplit
Full benchmark across every popular open-source separator: StemSplitio/stem-separation-benchmark-2026.
License & attribution
This repo is MIT-licensed, matching the original HT-Demucs.
Original authors (please cite if you use this model in research):
@inproceedings{rouard2023hybrid,
title = {Hybrid Transformers for Music Source Separation},
author = {Rouard, Simon and Massa, Francisco and D{\'e}fossez, Alexandre},
booktitle = {ICASSP},
year = {2023}
}- Original model: [
facebookresearch/demucs][demucs-repo] - Packaging by StemSplit
- Search keywords: drum extraction, isolate drums from song, drum stem extractor, AI drum separator
[demucs-repo]: https://github.com/facebookresearch/demucs
