Skip to content

Sam Audio · Visual Separate

Integrate

Model id sam-audio/visual-separate
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/sam-audio/visual-separate?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Files like the example: $0.05 50 API credits your files are measured before the run Run it on this page

Get API key
Meta Video to Audio 10–60 s #video-to-audio#sam-audio

Separates a sound from a video's audio track, guided by an optional mask video and text prompt

Meta · Data (JSON)

Your first result goes here

Build a request below and run it with your API key. Outputs are copied to our storage, kept forever or 7 days for free.

Build a request

Controls are generated from the model schema. The code and the price update as you change them.

default

Natural-language description of the target sound to aid separation.

•required video_url
Drop a file, or

Video file URL for processing, in formats such as MP4 or MOV.

default 1

Count of candidates generated for ranking.

Advanced mask_video_url · acceleration · output_format · max_chunk_duration · chunk_overlap
Drop a file, or

Mask video URL using a binary encoding in which the target object appears black against a white background.

acceleration default balanced

Acceleration level applied to processing.

output_format default wav

Format for the generated audio.

default 60

Per-pass audio limit, measured in seconds, beyond which processing uses overlapping chunks that are blended together.

default 5

Length of the overlap between chunks, measured in seconds, used for crossfade blending.

POST /run/sam-audio/visual-separate?wait=20 quote → $0.05
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/sam-audio/visual-separate?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Run this request

Your key stays in this browser: it is sent only to the Doitong API and saved (localStorage) only if you tick Remember. Get an API key

About Sam Audio · Visual Separate

Takes a `video_url` and extracts a target sound from its audio. An optional `mask_video_url` marks the target object (black for target, white for background), and `prompt` can add a text hint. Up to 4 `reranking_candidates` can be ranked, and long audio is chunked. Output has `target` and `residual` audio in wav or mp3.

Parameters

Send either the canonical name or the native name, not both. Canonical names

NameType DefaultAllowed Description
video_urlrequired video
Typeurl · video
Video file URL for processing, in formats such as MP4 or MOV.
mask_video_urloptional
Typeurl · video
Mask video URL using a binary encoding in which the target object appears black against a white background.
promptoptional
Typestring
Default
Natural-language description of the target sound to aid separation.
reranking_candidatesoptional
Typeinteger
Default1
1 – 4
Count of candidates generated for ranking.
accelerationoptional
Typeenum
Defaultbalanced
fastbalancedquality
Acceleration level applied to processing.
max_chunk_durationoptional
Typenumber
Default60
10 – 60
Per-pass audio limit, measured in seconds, beyond which processing uses overlapping chunks that are blended together.
chunk_overlapoptional
Typenumber
Default5
0 – 30
Length of the overlap between chunks, measured in seconds, used for crossfade blending.
output_formatoptional
Typeenum
Defaultwav
wavmp3
Format for the generated audio.
required Canonical name, also accepted

File parameters take a public https:// URL, a data: URI up to 10 MB, or the file_url of an upload. Files

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "sam-audio/visual-separate",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 50,
    "usd": "0.05",
    "charged": 50,
    "refunded": 0
  },
  "input": {
    "video_url": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4"
  },
  "output": {
    "target": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    },
    "residual": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    },
    "duration": 5,
    "sample_rate": 48000
  },
  "outputs": [
    {
      "type": "file",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Your files, your choiceEvery outputs[].url is a copy on our storage: kept forever (paid per GB-month) or 7 days for free, by your account setting or ?storage=.
Same shape on every modeltype, url, content_type, width, height and duration, for images, video and audio alike. output is the model’s own result object.
Fields of output
target
object {url, content_type, file_name, file_size}Target sound extracted in isolation.
residual
object {url, content_type, file_name, file_size}Audio remaining apart from the target sound.
duration
numberOutput audio length, measured in seconds.
sample_rate
integerSampling frequency in Hz for the output audio.

More models: Video to Audio

For AI agents: this page as Markdown is at https://doitong.com/en-US/developers/models/sam-audio/visual-separate.md. All models and guides: https://doitong.com/developers/llms.txt