audiostringrequired
Song file or URL to separate into stems.
meta/demucsDemucs by Meta separates a song into vocals, drums, bass, and other stems, plus guitar and piano with the 6-stem htdemucs_6s model, and returns each stem as its own audio file.
Try the model
Select an example to load its inputs and result into the playground.
{
"audio": "https://static.sandbase.ai/examples/0a0d0297-def8-4c83-b0ea-7c85683384e5/input/495c75cc-ee64-4e72-920b-adf2cee5a542.mp3"
}{
"audio": "https://static.sandbase.ai/examples/1907354f-c7dc-4441-9abc-c46eb9cdb4e0/input/4b75bc6c-eeb6-4620-a92d-c12ca90c1bbb.wav",
"output_format": "wav",
"separation_model": "htdemucs_6s"
}{
"audio": "https://static.sandbase.ai/examples/2af3f33a-33f4-4a64-a4ff-f33a517e9d43/input/62cee02c-d27d-4ce1-b3a2-46293836583f.mp3",
"separation_model": "htdemucs_ft"
}Demucs by Meta splits a song into separate stems: vocals, drums, bass, and other, plus guitar and piano with htdemucs_6s.
| Field | Type | Default | Notes |
|---|---|---|---|
audio | audio file or URL, required | — | Song to separate. |
separation_model | htdemucshtdemucs_fthtdemucs_6shdemucs_mmimdxmdx_extramdx_qmdx_extra_q | htdemucs_6s | Demucs variant; htdemucs_6s adds guitar and piano. |
output_format | wav / mp3 | mp3 | Format of each stem. |
| Field | Notes |
|---|---|
url | Vocals stem. |
drums_url | Drums stem. |
bass_url | Bass stem. |
other_url | Everything else. |
guitar_url | Guitar stem (htdemucs_6s only). |
piano_url | Piano stem (htdemucs_6s only). |
$0.0007 per started second of input audio. The quote uses the measured audio length.
| Audio | Price |
|---|---|
| 1 min | $0.042 |
| 3 min | $0.126 |
| 10 min | $0.42 |
Failed runs are not charged.
Related: meta/.
Start building
Submit this model through the SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "meta/demucs",
"audio": "https://static.sandbase.ai/examples/meta/demucs/input_audio_0.mp3",
"output_format": "mp3",
"separation_model": "htdemucs_6s"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Create a SandBase API key and set it in your server environment. All requests use Bearer authentication.
export SANDBASE_API_KEY="YOUR_API_KEY"Keep the key on your server. Do not expose it in browser code or commit it to a repository.
POST to /v1/run with this model ID and its inputs. The request example above includes submission and polling.
Use the returned run ID to poll until the status is completed, failed or timeout. Read output only after completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Pass a publicly accessible file URL in the model’s image, video or audio field. Supported formats and limits are shown beside each Playground input.
Use the upload or replace control on supported image fields in the Playground. Video URL fields accept a hosted driving video; they do not imply video-upload support.
audiostringrequiredSong file or URL to separate into stems.
output_formatstringAudio format of the separated stems.
Default: "mp3"
Possible values: "wav", "mp3"
separation_modelstringDemucs model used for separation. Only htdemucs_6s returns guitar and piano stems.
Default: "htdemucs_6s"
Possible values: "htdemucs", "htdemucs_ft", "htdemucs_6s", "hdemucs_mmi", "mdx", "mdx_extra", "mdx_q", "mdx_extra_q"
{
"model": "meta/demucs",
"audio": "https://static.sandbase.ai/examples/meta/demucs/input_audio_0.mp3",
"output_format": "mp3",
"separation_model": "htdemucs_6s"
}A completed run exposes its result in output. The following is the model’s saved example, not a new generation.
[
{
"bass_url": "https://static.sandbase.ai/examples/0a0d0297-def8-4c83-b0ea-7c85683384e5/output/ea9295ae-172f-48d9-b0eb-fedca97350cd.mp3",
"drums_url": "https://static.sandbase.ai/examples/0a0d0297-def8-4c83-b0ea-7c85683384e5/output/7060298f-c2d7-41b2-a6c4-01fe2f0f6337.mp3",
"guitar_url": "https://static.sandbase.ai/examples/0a0d0297-def8-4c83-b0ea-7c85683384e5/output/858f1499-2c8c-48b3-ad60-4d68fc7b67a9.mp3",
"other_url": "https://static.sandbase.ai/examples/0a0d0297-def8-4c83-b0ea-7c85683384e5/output/2ad49ed2-7666-46b7-a220-9bc9b6256b12.mp3",
"piano_url": "https://static.sandbase.ai/examples/0a0d0297-def8-4c83-b0ea-7c85683384e5/output/158896e5-fa6a-4113-b587-1062a388bbf7.mp3",
"url": "https://static.sandbase.ai/examples/0a0d0297-def8-4c83-b0ea-7c85683384e5/output/847911b8-760a-4bb2-aac1-9b32da6e432d.mp3"
}
]