HT-Demucs: AI-powered music source separation with web interface
454
A modern web application for audio source separation using Demucsā . Split music tracks into separate stems (bass, drums, vocals, and other instruments) through an intuitive web interface with real-time progress tracking.
This project is based on xserrat/docker-facebook-demucsā , which provides an excellent Dockerized implementation of Demucs. This repository extends that foundation with a full-featured web application, real-time processing updates, YouTube integration, and an interactive audio player.
This application is intended for local or trusted LAN use only.
yt-dlp inside the server container (no Docker socket / privileged mode required).Check your system:
make check
The fastest way to get started is using our pre-built images from Docker Hub:
# Run the server (it will automatically pull the image)
docker run -d --rm \
--name htdemucs \
-p 8080:8080 \
-v $(pwd)/output:/app/output \
-v $(pwd)/models:/data/models \
higginsrob/htdemucs:latest
With GPU support:
docker run -d --rm \
--name htdemucs \
--gpus all \
-p 8080:8080 \
-v $(pwd)/output:/app/output \
-v $(pwd)/models:/data/models \
higginsrob/htdemucs:latest
Then open http://localhost:8080ā in your browser!
Clone this repository
git clone [email protected]:higginsrob/htdemucs.git demucs
cd demucs
Start the server
make dev
This will:
Open in your browser
http://localhost:8080
For running in the background on a trusted machine (not internet-facing without extra hardening ā see Securityā ):
# Build and start server in background
make server-run
# View logs
make server-logs
# Stop server
make server-stop
If you have an NVIDIA GPU with CUDA:
make server-run-gpu
āāāāāāāāāāāāāāāāāāā
ā Web Browser ā
ā (Static HTML) ā
āāāāāāāāāā¬āāāāāāāāā
ā HTTP/WebSocket
ā
āāāāāāāāāāāāāāāāāāā
ā Flask Server ā
ā + Socket.IO ā
āāāāāāāāāā¬āāāāāāāāā
ā
ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāā
ā Job Manager āāāāāāā Demucs Core ā
ā (Queue System) ā ā (Processor) ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāā
ā
ā
āāāāāāāāāāāāāāāāāāā
ā File Storage ā
ā /app/output ā
āāāāāāāāāāāāāāāāāāā
POST /api/upload - Upload audio file for processingPOST /api/upload_youtube - Submit YouTube URL for processingGET /api/jobs - List all jobsGET /api/jobs/<job_id> - Get job statusGET /api/jobs/<job_id>/stems - List available stemsGET /api/jobs/<job_id>/stems/<stem> - Stream audio stemDELETE /api/jobs/<job_id> - Cancel/delete jobprogress - Processing progress updates (0-100%)completed - Job completed successfullyfailed - Job failed with error message.
āāā demucs/ # Demucs Docker base image
ā āāā Dockerfile # Base Demucs image
ā āāā models/ # Downloaded model cache (persisted)
ā āāā output/ # Processed stems (persisted)
āāā server/ # Web application
ā āāā Dockerfile # Web server image (extends demucs)
ā āāā app/
ā ā āāā server.py # Flask application
ā ā āāā services/ # Business logic
ā ā ā āāā demucs_processor.py
ā ā ā āāā job_manager.py
ā ā ā āāā youtube_service.py
ā ā āāā utils/ # Validation, helpers
ā āāā static/ # Frontend assets
ā ā āāā index.html # Main UI
ā ā āāā css/style.css # Styling
ā ā āāā js/ # Client-side JavaScript
ā ā āāā app.js # Main application
ā āāā requirements.txt # Python dependencies
āāā scripts/ # Helper scripts
āāā Makefile # Build and run commands
āāā README.md # This file
Edit static files (HTML/CSS/JS)
# Files are live-mounted, just refresh browser
# Edit: server/static/**/*
Edit Python code
# Rebuild and restart
make dev
Test changes
# Upload a test file via the web UI
# Watch logs in the terminal
View logs
make server-logs
make help # Show all available commands
make check # Check system prerequisites
make build # Build base Demucs image
make server-build # Build web server image
make server-run # Run in background (production)
make dev # Run in foreground (development)
make server-stop # Stop server
make server-logs # View logs
make clean-outputs # Clean processed files
make clean-all # Clean everything
| Model | Description | Stems | Best For |
|---|---|---|---|
htdemucs | Hybrid Transformer Demucs | 4 | General use, balanced quality/speed |
htdemucs_ft | Fine-tuned version (default) | 4 | Best quality, recommended |
htdemucs_6s | 6-stem model | 6 | Bass, drums, vocals, guitar, piano, other |
mdx_extra | MDX-Net Extra | 4 | Alternative high-quality option |
Pre-built multi-architecture Docker images (linux/amd64, linux/arm64) are published to Docker Hub via GitHub Actions:
Images are automatically built on:
main branchSee .github/workflows/README.mdā for complete CI/CD documentation.
# Check Docker is running
docker info
# Check port 8080 is available
lsof -i :8080
# View detailed logs
make server-logs
make server-run-gpu if you have an NVIDIA GPUhtdemucs instead of htdemucs_ft for faster processingMake sure the models volume is properly mounted:
docker inspect demucs | grep models
# Clean old outputs
make clean-outputs
Contributions welcome! Please see instructions/DEVELOPMENT.mdā for guidelines.
This repository is released under the MIT license as found in the LICENSEā file.
Content type
Image
Digest
sha256:93d9c87fcā¦
Size
600.5 MB
Last updated
3 months ago
docker pull higginsrob/htdemucs