Ana içeriğe geç
meta avatarı

Demucs API

meta/demucs

Bir şarkıyı tek çağrıda enstrümantal ve izole vokal olarak ikiye ayırın; ses dakikasına göre değil, işlem süresine göre fiyatlandırılır.

segmentasyon
A100
0.0184565

Model girdisi

Input

URL of the audio file to separate. This is built for a full-band music mix with the lead vocal present - a solo vocal, or a track that is already instrumental, has nothing to split. Decoding is ffmpeg-backed, so wav, mp3, flac and ogg/vorbis all work. There is no length limit: both runtime and price grow with the duration of the track, because this endpoint bills by second of compute.

Additional Settings

Customize your input with more control.

Which separation network runs. htdemucs (the default) is the first Hybrid Transformer Demucs, trained on MusDB plus 800 songs. htdemucs_ft is its fine-tuned version: separation will take 4 times more time but might be a bit better, and because this endpoint bills compute time it costs roughly four times as much too. htdemucs_6s adds guitar and piano as internal sources, but the result here is still the same vocal/instrumental pair. hdemucs_mmi is the earlier Hybrid Demucs v3, retrained on the same data. mdx_q and mdx_extra_q are quantized versions of the older models - a smaller download, and quality can be slightly worse. Every value supports the vocal split, so the choice only trades quality against time and cost.

Container the two returned files are encoded in. mp3 (the default) is the smallest; flac is lossless and compressed; wav is lossless and uncompressed. Both files always come back in the same format.

Min: 64 - Max: 320

Bitrate in kbps for MP3 output. Higher means better quality and a larger file. Has no effect unless output_format is mp3.

Min: 1 - Max: 2

How many random-shift passes to average. Each extra shift re-runs the whole separation on a shifted copy of the input and averages the results, which can steady a split that sounds unstable - and multiplies both the runtime and, because this endpoint bills compute time, the price. 1 (a single pass) is the default and is right for almost every track; 2 is the highest value accepted here.

What to do when a separated track goes past full scale. rescale (the default) scales the whole signal down so nothing clips; clamp allows hard clipping; none leaves the samples untouched.

You need to be logged in to run this model and view results.
Log in

Model çıktısı

Output

Loading
Loading
Generated in 21.466 seconds
Logs (1 lines)

Örnek istekler

Örnekler

Demucs API

Demucs is a audio-to-audio AI model by meta. On ModelRunner it runs through a REST API or via MCP from any AI assistant, at about $0.0184565 per audio clip.

POST https://queue.modelrunner.run/meta/demucs

cURL

# Submit a request to the queue. Input fields go at the top level of the
# body. The optional reserved "metadata" object holds your own flat string
# tags — stored on the request, never sent to the model; filter later with
# GET https://queue.modelrunner.run/requests?metadata=<url-encoded JSON>.
curl -X POST https://queue.modelrunner.run/meta/demucs \
  -H "Authorization: Key $MRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "audio": "https://media.modelrunner.ai/PaQdzfOxdsluPtzQcXZDm.wav",
    "model": "htdemucs",
    "shifts": 1,
    "clip_mode": "rescale",
    "mp3_bitrate": 320,
    "output_format": "mp3",
    "metadata": {
      "project": "my-project"
    }
  }'
# → { "request_id": "...", "status_url": "...", "response_url": "..." }

# Poll status_url until "COMPLETED", then fetch the result
curl "https://queue.modelrunner.run/meta/demucs/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/meta/demucs/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("meta/demucs", {
  input: {
    "audio": "https://media.modelrunner.ai/PaQdzfOxdsluPtzQcXZDm.wav",
    "model": "htdemucs",
    "shifts": 1,
    "clip_mode": "rescale",
    "mp3_bitrate": 320,
    "output_format": "mp3"
  },
});
console.log(result);

Python

import os
import requests

headers = {"Authorization": f"Key {os.environ['MRUN_API_KEY']}"}

submitted = requests.post(
    "https://queue.modelrunner.run/meta/demucs",
    headers=headers,
    json={
      "audio": "https://media.modelrunner.ai/PaQdzfOxdsluPtzQcXZDm.wav",
      "model": "htdemucs",
      "shifts": 1,
      "clip_mode": "rescale",
      "mp3_bitrate": 320,
      "output_format": "mp3"
    },
).json()

# Poll submitted["status_url"] until "COMPLETED", then:
result = requests.get(submitted["response_url"], headers=headers).json()

Input parameters

Input parameters of Demucs
NameTypeRequiredDescription
audiostring (uri)yesURL of the audio file to separate. This is built for a full-band music mix with the lead vocal present - a solo vocal, or a track that is already instrumental, has nothing to split. Decoding is ffmpeg-backed, so wav, mp3, flac and ogg/vorbis all work. There is no length limit: both runtime and price grow with the duration of the track, because this endpoint bills by second of compute.
modelenumnoWhich separation network runs. htdemucs (the default) is the first Hybrid Transformer Demucs, trained on MusDB plus 800 songs. htdemucs_ft is its fine-tuned version: separation will take 4 times more time but might be a bit better, and because this endpoint bills compute time it costs roughly four times as much too. htdemucs_6s adds guitar and piano as internal sources, but the result here is still the same vocal/instrumental pair. hdemucs_mmi is the earlier Hybrid Demucs v3, retrained on the same data. mdx_q and mdx_extra_q are quantized versions of the older models - a smaller download, and quality can be slightly worse. Every value supports the vocal split, so the choice only trades quality against time and cost. One of: htdemucs, htdemucs_ft, htdemucs_6s, hdemucs_mmi, mdx_q, mdx_extra_q. Default: "htdemucs".
output_formatenumnoContainer the two returned files are encoded in. mp3 (the default) is the smallest; flac is lossless and compressed; wav is lossless and uncompressed. Both files always come back in the same format. One of: mp3, flac, wav. Default: "mp3".
mp3_bitrateintegernoBitrate in kbps for MP3 output. Higher means better quality and a larger file. Has no effect unless output_format is mp3. Default: 320.
shiftsintegernoHow many random-shift passes to average. Each extra shift re-runs the whole separation on a shifted copy of the input and averages the results, which can steady a split that sounds unstable - and multiplies both the runtime and, because this endpoint bills compute time, the price. 1 (a single pass) is the default and is right for almost every track; 2 is the highest value accepted here. Default: 1.
clip_modeenumnoWhat to do when a separated track goes past full scale. rescale (the default) scales the whole signal down so nothing clips; clamp allows hard clipping; none leaves the samples untouched. One of: rescale, clamp, none. Default: "rescale".

Machine-readable: OpenAPI schema · llms.txt

Use Demucs from Claude & Cursor (MCP)

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and Demucs becomes a tool your assistant can call directly — it authorizes via OAuth (no API key in config) and runs this model with the run_model tool using the endpoint meta/demucs.

MCP client config (Claude Desktop, Cursor)

{
  "mcpServers": {
    "modelrunner": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.modelrunner.run/mcp"]
    }
  }
}

Claude Code

claude mcp add --transport http modelrunner https://mcp.modelrunner.run/mcp

Then ask your assistant, for example: “Run meta/demucs on ModelRunner to generate audio”. MCP setup guide.

Model Detayları

Model Detayları

Demucs, mikslenmiş bir müzik kaydını iki hazır ses dosyasına ayırır: vokali çıkarılmış enstrümantal ve izole edilmiş vokalin kendisi. Tek bir ses dosyası gönderin; ikisi de tam uzunlukta ve 44.1 kHz olarak döner. Decode işini ffmpeg üstlendiği için wav, mp3, flac ve ogg dosyalarının hepsi çalışır. Altta Hybrid Transformer Demucs (`htdemucs`) çalışır; bu ağ, özellikle müzik kaynak ayrıştırması için MusDB ve buna ek 800 şarkıyla eğitilmiştir. Prompt yoktur: ayrım sabittir, bu da sonucu bütün bir katalog boyunca öngörülebilir kılar.

## En uygun olduğu işler - Bir şarkıdan ana vokali çıkararak karaoke ya da altyapı parçası hazırlamak - Remix ya da sample için bitmiş bir miksten a cappella vokali çekip almak - Mashup, cover ya da DJ edit için vokal ve enstrümantal stem’leri hazırlamak - Bir müzik kütüphanesini toplu işleyip vokal/enstrümantal çiftlerine ayırmak - Transkripsiyon ya da şarkı sözü hizalaması için temiz bir vokal elde etmek

## Şu durumlarda başka bir model seçin - Adıyla belirttiğiniz tek bir enstrümanı ya da sözcüklerle tarif edebileceğiniz herhangi bir sesi istiyorsanız — `meta/sam-audio/separate` bir metin prompt’u alır ve adını verdiğiniz sesi izole eder. - Müziği ayırmak yerine bir konuşma kaydını temizlemek istiyorsanız — `rikorose/deepfilternet3` ve `elevenlabs/audio-isolation` ayrım yapmaz, bunun yerine gürültüyü giderir. - Davulu, bası ve geri kalan partileri ayrı dosyalar olarak almanız gerekiyorsa — bu endpoint yalnızca vokali ve onun dışındaki her şeyi döndürür.

## İpuçları - Çıktı, her zaman aynı sırada gelen iki URL’den oluşan bir dizidir: 0. indeks enstrümantal, 1. indeks izole vokaldir. - Vokalin makul ölçüde duyulduğu tam bantlı bir miks verin — tek başına bir vokalde ya da enstrümantal bir parçada ayrılacak bir şey yoktur. - Faturalandırma işlem süresinin saniyesi üzerindendir ve bu süre parçanın uzunluğuyla artar: 30 saniyelik bir klip yaklaşık 4.5 saniye sürdü. - Bir sonuç sizi tatmin etmedikçe `model` değerini `htdemucs` bırakın: `htdemucs_ft` "biraz daha iyi olabilir", ancak dört kat uzun sürer ve yaklaşık dört kat pahalıdır. - `shifts` değerini yalnızca bir ayrım kararsız duyuluyorsa yükseltin: her ek shift, ayrımı bir kez daha çalıştırıp geçişlerin ortalamasını alır; süre ve fiyat da buna göre katlanır.

## Gelişmiş Yapılandırma - `model` ayrıştırma ağını seçer; her değer aynı vokal/enstrümantal çiftini döndürür, yani yalnızca kaliteyle süre ve maliyet arasında bir denge kurar. - `clip_mode`, seviyesi full scale’i aşan bir parçanın nasıl ele alınacağını belirler: `rescale` (varsayılan) sinyalin tamamını ölçekleyerek düşürür, `clamp` sinyali sert biçimde kırpar (hard clipping), `none` ise sinyale dokunmaz.

ModelRunner JavaScript client ile çalıştırmak için: ```js import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("meta/demucs", { input: { audio: "https://media.modelrunner.ai/PlbJ07n9klVvKGysT4qdy.wav", model: "htdemucs", output_format: "mp3", }, }); // result.output[0] -> instrumental, result.output[1] -> isolated vocal ```