Spaces:
Sleeping
title: SeparateTracks
emoji: 🎼
colorFrom: red
colorTo: yellow
sdk: docker
sdk_version: 6.13.0
app_file: app.py
tags:
- audio
- music
- tools
- MCP
pinned: false
short_description: Separate tracks from mixed audio
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
SeparateTracks
Download audio from YouTube, separate it into instrument stems with Demucs, and view the results in a Gradio AudioGallery UI with MCP support.
Features
- Accepts either a raw YouTube video ID or a full YouTube URL.
- Accepts
.wavor.mp3uploads as a local audio override for separation. - Builds a 7-track output gallery for drums, vocals, guitar, bass, other, piano, and combined music, with a download link under each play button.
- Exposes an MCP endpoint at
/gradio_api/mcp/sse.
Usage
Run the app locally (not admin):
pip install -r requirements.txt
python app.py
py -m app -Xfrozen_modules=off
Then open http://localhost:7860 and use one of these flows:
- Paste a YouTube video ID or full URL into
YouTube Video ID or URLand clickSeparate Tracks. - Upload a
.wavor.mp3file intoAudio File Override (.wav or .mp3)and clickSeparate Tracks.
If an upload is present, it takes precedence over the YouTube field.
Outputs
Separated files are written under separated/htdemucs_6s/{job_id}/.
For YouTube sources, job_id is the sanitized video title when available,
falling back to the video ID. For uploaded audio, job_id is a sanitized
version of the uploaded filename stem. Each stem card in the gallery can be
played in place or downloaded directly.
Extractors & Cookies
For details about yt-dlp extractor behavior, see the official documentation:
If you need authenticated extraction (for age-restricted or otherwise protected content), one way to provide cookies safely is via a private/incognito browser session:
- Open a new private browsing/incognito window and log into YouTube.
- In the same window and same tab from step 1, navigate to https://www.youtube.com/robots.txt (this should be the only private/incognito browsing tab open).
- Export youtube.com cookies from the browser, then close the private/ incognito window so that the session is never opened in the browser again.
Upload the exported cookies file in the app UI when prompted.