Back to browse
GitHub Repository

Rust powered waveform source separation

121 starsRust

Demucs music stem separator rewritten in Rust – runs in the browser

by nikhilunni·Mar 3, 2026·19 points·3 comments

AI Analysis

●●●BangerWizardryZero to One

Music stem separation in the browser without uploads—Rust + WebGPU beats cloud dependency.

Strengths
  • No Python runtime required; full Rust stack compiles to WASM—eliminates environment friction
  • Three shipping formats (web, CLI, VST3/CLAP) maximize reach; DAW plugin with MIDI-gated playback is genuine tooling
  • WebGPU on consumer hardware makes state-of-the-art model practical without API calls or subscriptions
Weaknesses
  • DAW plugin macOS-only limits producer adoption; Linux/Windows left out
  • WebGPU browser support still spotty—Chrome/Edge only gates casual users
Category
Target Audience

Music producers, audio engineers, mastering professionals, open-source contributors

Similar To

Deezer Spleeter · iZotope RX · UVR5

Post Description

Hi HN! I reimplemented HTDemucs v4 (Meta's music source separation model) in Rust, using Burn. It splits any song into individual stems — drums, bass, vocals, guitar, piano — with no Python runtime or server involved.

Try it now: https://nikhilunni.github.io/demucs-rs/ (needs a WebGPU-capable browser — Chrome/Edge work best)

GitHub: https://github.com/nikhilunni/demucs-rs

It runs three ways:

- In the browser — the full ML inference pipeline compiles to WASM and runs on your GPU via WebGPU. No uploads, nothing leaves your machine.

- Native CLI — Metal on macOS, Vulkan on Linux/Windows. Faster than the browser path.

- DAW plugin — VST3/CLAP plugin for macOS with a native SwiftUI UI. Load a track, separate it, drag stems directly into your DAW timeline, or play as a MIDI instrument with solo / faders.

The core inference library is built on Burn (https://burn.dev), a Rust deep learning framework. The same `demucs-core` crate compiles to both native and `wasm32-unknown-unknown` — the only thing that changes is the GPU backend.

Model weights are F16 safetensors hosted on Hugging Face and downloaded / cached automatically on first use on all platforms. Three variants: standard 4-stem (84 MB), 6-stem with guitar/piano (84 MB), and a fine-tuned bag-of-4-models for best quality (333 MB).

The existing implementations I found online were mostly wrappers around the original Python implementation, and not very portable -- the model works remarkably well and I wanted to be able to quickly create samples / remixes without leaving the DAW or my browser. Right now the implementation is pretty MacOS heavy, as that's what I'm testing with, but all of the building blocks for other platforms are ready to build on. I want this to grow to be a general utility for music producers, not just "works on my machine."

It was a fun first foray into DSP and the state of the art of ML over WASM, with lots of help from Claude!

Similar Projects