Video Background Remover App API
Use video-background-remover to remove the background from one uploaded video and return a foreground video suitable for editing, compositing, and transparent-video workflows.
App id
video-background-remover
Use this id with /api/v1/apps/{app} and /api/v1/apps/{app}/generations.
Inputs
| Parameter | Type | Required | Default | Values | Description |
|---|---|---|---|---|---|
source_video |
array | Yes | None | Source file URL array | One source video URL. Supported formats: MP4, WebM, MOV, M4V. Max size: 500 MB. |
refine_foreground_edges |
boolean | No | true |
true, false |
Improve edge detail around the subject when possible. |
subject_is_person |
boolean | No | true |
true, false |
Enable when the foreground subject is a person. |
source_video must be an array because app media inputs use array parameters. For this app, provide exactly one URL.
Billing
The current configuration charges 1 credit per input video second, rounded up, with a minimum charge of 1 credit.
Img2Vid calculates the source video duration server-side from the submitted URL. Do not send duration fields to control billing.
Output
The app returns a video URL in result.videos[].url. The current workflow is configured for a transparent-background video output suitable for compositing.
Get app parameters
curl https://img2vid.net/api/v1/apps/video-background-remover \
-H "Authorization: Bearer $BUBLE_API_KEY"
Example response:
{
"data": {
"id": "video-background-remover",
"input_parameters": [
{
"name": "source_video",
"type": "array"
},
{
"name": "refine_foreground_edges",
"type": "boolean"
},
{
"name": "subject_is_person",
"type": "boolean"
}
]
}
}
Create a generation
curl https://img2vid.net/api/v1/apps/video-background-remover/generations \
-H "Authorization: Bearer $BUBLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source_video": ["https://example.com/source-video.mp4"],
"refine_foreground_edges": true,
"subject_is_person": true
}'
Example response:
{
"data": {
"id": "task_id",
"status": "pending"
}
}
Query the result
curl https://img2vid.net/api/v1/apps/video-background-remover/generations/task_id \
-H "Authorization: Bearer $BUBLE_API_KEY"
Success response shape:
{
"data": {
"id": "task_id",
"status": "success",
"result": {
"videos": [
{
"url": "https://..."
}
]
}
}
}
SDK examples
The examples below use this page's app id and public input parameters. They assume you have already initialized the SDK client as shown in the Quickstart and imported the required language SDK types. Send only parameter names returned by /api/v1/apps/{app}; media parameters must receive URLs.
JavaScript / TypeScript
const task = await buble.apps.generations.create('video-background-remover', {
source_video: ['https://example.com/source.mp4'],
refine_foreground_edges: true,
subject_is_person: true,
});
const result = await buble.apps.generations.wait(
'video-background-remover',
task.data.id
);
console.log(result.data.result?.videos?.[0]?.url);
Python
task = client.apps.generations.create(
"video-background-remover",
source_video=["https://example.com/source.mp4"],
refine_foreground_edges=True,
subject_is_person=True,
)
result = client.apps.generations.wait("video-background-remover", task["data"]["id"])
print(result["data"]["result"]["videos"][0]["url"])
Go
task, err := client.Apps.Generations.Create(ctx, "video-background-remover", map[string]any{
"source_video": []string{"https://example.com/source.mp4"},
"refine_foreground_edges": true,
"subject_is_person": true,
})
if err != nil {
return err
}
result, err := client.Apps.Generations.Wait(ctx, "video-background-remover", task.Data.ID)
Rust
let mut body = serde_json::Map::new();
body.insert("source_video".to_string(), serde_json::json!(["https://example.com/source.mp4"]));
body.insert("refine_foreground_edges".to_string(), serde_json::json!(true));
body.insert("subject_is_person".to_string(), serde_json::json!(true));
let task = client.apps().generations().create("video-background-remover", body).await?;
let result = client
.apps()
.generations()
.wait("video-background-remover", &task.data.id, WaitOptions::default())
.await?;
Swift
let task = try await client.apps.generations.create(
"video-background-remover",
body: [
"source_video": ["https://example.com/source.mp4"],
"refine_foreground_edges": true,
"subject_is_person": true
]
)
let result = try await client.apps.generations.wait("video-background-remover", task.data.id)
Dart / Flutter
final task = await client.apps.generations.create('video-background-remover', {
'source_video': ['https://example.com/source.mp4'],
'refine_foreground_edges': true,
'subject_is_person': true,
});
final result = await client.apps.generations.wait('video-background-remover', task.data.id);
Elixir
{:ok, task} =
Buble.Apps.Generations.create(client, "video-background-remover", %{
source_video: ["https://example.com/source.mp4"],
refine_foreground_edges: true,
subject_is_person: true
})
{:ok, result} = Buble.Apps.Generations.wait(client, "video-background-remover", task["data"]["id"])
Java
Envelope<AppGenerationTask> task = client.apps().generations().create(
"video-background-remover",
Map.of(
"source_video", List.of("https://example.com/source.mp4"),
"refine_foreground_edges", true,
"subject_is_person", true));
Envelope<AppGenerationTask> result = client.apps().generations().wait(
"video-background-remover",
task.getData().getId());
.NET
var task = await client.Apps.Generations.CreateAsync(
"video-background-remover",
new Dictionary<string, object?>
{
["source_video"] = new[] { "https://example.com/source.mp4" },
["refine_foreground_edges"] = true,
["subject_is_person"] = true
});
var result = await client.Apps.Generations.WaitAsync(
"video-background-remover",
task!.Data!.Id!);
PHP
$task = $client->apps()->generations()->create('video-background-remover', [
'source_video' => ['https://example.com/source.mp4'],
'refine_foreground_edges' => true,
'subject_is_person' => true,
]);
$result = $client->apps()->generations()->wait('video-background-remover', $task['data']['id']);
Ruby
task = client.apps.generations.create("video-background-remover", {
"source_video" => ["https://example.com/source.mp4"],
"refine_foreground_edges" => true,
"subject_is_person" => true
})
result = client.apps.generations.wait("video-background-remover", task.dig("data", "id"))
puts result.dig("data", "result", "videos", 0, "url")