AI-Powered Audio Stem Separation for YouTube
Centrifugue is a browser extension that extracts audio stems (vocals, drums, bass, other) from YouTube videos using Demucs, a state-of-the-art AI model from Meta.
- macOS (Apple Silicon recommended for GPU acceleration)
- Firefox, Zen Browser, or Google Chrome
- Python 3.9+
- Homebrew (for installing dependencies)
git clone https://github.com/yourusername/centrifugue.git
cd centrifugue
./install.shThis will:
- Check/install required dependencies (yt-dlp, ffmpeg)
- Create a Python virtual environment
- Install Demucs and its dependencies
- Configure native messaging hosts for all browsers
- Open Firefox or Zen Browser
- Go to
about:debugging#/runtime/this-firefox - Click "Load Temporary Add-on"
- Navigate to the
extensionfolder - Select
manifest.json
- Open Chrome and go to
chrome://extensions - Enable Developer mode (toggle in top right)
- Click Load unpacked
- Navigate to the
extension-chromefolder - Go to a YouTube video and click the floating 🎵 button
- A setup overlay will appear with a Terminal command - click Copy and run it
- Reload the page
Note: Chrome requires a one-time setup because unpacked extensions get a unique ID. The extension detects this and shows the setup instructions automatically.
- One-Click MP3 Download - Extract audio from any YouTube video
- AI Stem Separation - Split audio into individual stems using Demucs
- Genre Modes:
- Full - All 4 stems (vocals, drums, bass, other)
- Hip Hop - Vocals + Beat (combined instrumental)
- Rock - Vocals, Drums, Bass
- Quality Presets:
- Fast (~2 min) - Quick processing
- Detailed (~5 min) - Higher quality separation
- Floating Button - Access directly from YouTube without opening the extension
- Background Processing - Continue browsing while stems are extracted
- Real-time Progress - See actual Demucs progress, not just estimates
- Apple Silicon Optimized - Uses MPS GPU acceleration on M1/M2/M3 Macs
- Navigate to any YouTube video
- Click the floating 🎵 button in the bottom-right corner
- Choose your options:
- Download MP3 - Quick audio download
- Download Stems - AI-powered stem separation
- For stems, select:
- Genre mode (Full, Hip Hop, or Rock)
- Quality preset (Fast or Detailed)
- Click "Download Stems" and wait for processing
You can close the popup or navigate to other videos - processing continues in the background!
MP3 Download:
~/Downloads/
└── Song Title.mp3
Stems Download:
~/Downloads/
└── Song Title - Stems/
├── Song Title - Vocals.mp3
├── Song Title - Drums.mp3
├── Song Title - Bass.mp3
└── Song Title - Other.mp3
centrifugue/
├── extension/ # Firefox/Zen extension
│ ├── manifest.json # Extension configuration
│ ├── background.js # Native messaging & progress polling
│ ├── content.js # Floating UI on YouTube pages
│ └── popup/ # Extension popup UI
├── extension-chrome/ # Chrome extension (Manifest V3)
│ ├── manifest.json # Chrome extension configuration
│ ├── background.js # Service worker for native messaging
│ ├── content.js # Floating UI on YouTube pages
│ └── popup/ # Extension popup UI
├── native-host/ # Native messaging host
│ └── centrifugue_host.py # Python backend
├── venv-demucs/ # Python venv (created by install.sh)
└── install.sh # Installation script
The extension communicates with a Python native messaging host that:
- Downloads audio using yt-dlp
- Spawns an independent worker process for stem separation
- Runs Demucs with real-time progress parsing
- Reports progress via JSON files that the extension polls
Run ./install.sh to set up the virtual environment with Demucs.
Make sure you've updated the Chrome native messaging manifest with your extension ID:
- Go to
chrome://extensionsand copy your extension ID - Edit
native-host/com.centrifugue.stemextractor.chrome.json - Replace
YOUR_EXTENSION_ID_HEREwith your extension ID
- Use the "Fast" quality preset for quicker results
- Ensure you're on Apple Silicon for GPU acceleration (MPS)
- Close other GPU-intensive applications
- Check that the extension is loaded in
about:debugging - Verify native messaging is set up:
ls -la ~/Library/Application\ Support/Mozilla/NativeMessagingHosts/
- Look for errors in the browser console (F12 → Console)
- Check that the extension is loaded in
chrome://extensions - Verify native messaging is set up:
ls -la ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/ cat ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.centrifugue.stemextractor.json
- Ensure the extension ID in the manifest matches your loaded extension
Centrifugue uses Firefox cookies to authenticate with YouTube (required due to YouTube's bot detection). If downloads fail:
- Make sure Firefox is your default browser or at least has been used to browse YouTube recently
- Update yt-dlp:
brew upgrade yt-dlp - Test directly:
yt-dlp --cookies-from-browser firefox -x --audio-format mp3 "https://www.youtube.com/watch?v=VIDEO_ID"
Note: If you see errors about "SABR streaming" or "403 Forbidden", this is a YouTube restriction. The Firefox cookies workaround should resolve it.
MIT License