A web application that separates audio into stems (vocals, drums, bass, guitar, other) using Demucs. Supports uploads, YouTube URLs, and Spotify links.
- Upload audio files for stem separation
- Extract stems from YouTube videos
- Extract stems from Spotify tracks
- High-quality separation using Demucs'
htdemucs_6smodel - Easy-to-use web interface built with Gradio
The most convenient way to run the application is using Docker. Two commands and you're done!
-
Get the latest Docker image:
docker pull darioloi/stemsep
-
Run the container:
docker run -p 7860:7860 darioloi/stemsep
This will run the app without GPU support.
-
If you want to use GPU acceleration, ensure you have NVIDIA Container Toolkit installed. Then run:
docker run --gpus all -p 7860:7860 darioloi/stemsep
-
Access the web interface at http://localhost:7860
If you prefer to run the application locally, you can install it using pip. It's recommended to use a virtual environment to avoid conflicts with other packages. Also check out uv for a better local python experience.
Warning
Running locally (or in a .venv) will automatically use CUDA if available. If you want to run it without GPU, change the line in app.py:
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")to:
device = torch.device("cpu")-
Clone the repository:
git clone https://github.com/dario-loi/stemsep.git cd stemsep -
Install dependencies:
pip install -r requirements.txt
-
Install ffmpeg (required for audio processing):
- Ubuntu/Debian:
sudo apt-get install ffmpeg - macOS:
brew install ffmpeg - Windows: Download from ffmpeg.org
- Ubuntu/Debian:
-
Run the application:
python app.py
-
Access the web interface at http://localhost:7860
-
Run with Docker Compose, this will automatically enable GPU support
docker-compose up --build
-
If you want to run it without GPU, use:
docker-compose -f docker-compose.cpu.yml up --build
-
Access the web interface at http://localhost:7860
Note
While spotify-dl doesn't require API keys for downloading, it still needs them to access Spotify metadata.
- Visit Spotify Developer Dashboard
- Create a new application
- Set environment variables:
export SPOTIFY_CLIENT_ID="your_client_id" export SPOTIFY_CLIENT_SECRET="your_client_secret"
For Docker, add these variables to your environment:
docker run -p 7860:7860 \
-e SPOTIFY_CLIENT_ID="your_client_id" \
-e SPOTIFY_CLIENT_SECRET="your_client_secret" \
audio-stem-separatorFor Docker Compose, add to docker-compose.yml:
services:
stem-separator:
environment:
- SPOTIFY_CLIENT_ID=your_client_id
- SPOTIFY_CLIENT_SECRET=your_client_secret- Access the web interface at http://localhost:7860
- Choose a tab based on your input (Upload, YouTube, or Spotify)
- Provide the audio/URL and click "Process"
- Download the separated stems