{
"bg_type": "Video",
"bg_video": "https://replicate.delivery/pbxt/LmCPnNpvVF2gNBQrtlSiMTBvDw34dU77VvcuCNgk5ZxoAaDd/-2024-09-26-05-50-28.mp4",
"color": "#00FF00",
"fps": 0,
"input_video": "https://replicate.delivery/pbxt/LmCPnIRa9EXdXvlnO0Ueq2gKh2jzCWkwzigdXSUMBStQX5Oh/videoplayback%20%28online-video-cutter.com%29%20%281%29.mp4",
"video_handling": "loop"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_eME**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run tahercoolguy/video_background_remover_appender using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"tahercoolguy/video_background_remover_appender:7f43046e67290923eb7ea9f1b5d15e9feb4e9f047b61dd008ec2d205718328af",
{
input: {
bg_type: "Video",
bg_video: "https://replicate.delivery/pbxt/LmCPnNpvVF2gNBQrtlSiMTBvDw34dU77VvcuCNgk5ZxoAaDd/-2024-09-26-05-50-28.mp4",
color: "#00FF00",
fps: 0,
input_video: "https://replicate.delivery/pbxt/LmCPnIRa9EXdXvlnO0Ueq2gKh2jzCWkwzigdXSUMBStQX5Oh/videoplayback%20%28online-video-cutter.com%29%20%281%29.mp4",
video_handling: "loop"
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_eME**********************************
This is your API token. Keep it to yourself.
import replicate
Run tahercoolguy/video_background_remover_appender using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"tahercoolguy/video_background_remover_appender:7f43046e67290923eb7ea9f1b5d15e9feb4e9f047b61dd008ec2d205718328af",
input={
"bg_type": "Video",
"bg_video": "https://replicate.delivery/pbxt/LmCPnNpvVF2gNBQrtlSiMTBvDw34dU77VvcuCNgk5ZxoAaDd/-2024-09-26-05-50-28.mp4",
"color": "#00FF00",
"fps": 0,
"input_video": "https://replicate.delivery/pbxt/LmCPnIRa9EXdXvlnO0Ueq2gKh2jzCWkwzigdXSUMBStQX5Oh/videoplayback%20%28online-video-cutter.com%29%20%281%29.mp4",
"video_handling": "loop"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_eME**********************************
This is your API token. Keep it to yourself.
Run tahercoolguy/video_background_remover_appender using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "tahercoolguy/video_background_remover_appender:7f43046e67290923eb7ea9f1b5d15e9feb4e9f047b61dd008ec2d205718328af",
"input": {
"bg_type": "Video",
"bg_video": "https://replicate.delivery/pbxt/LmCPnNpvVF2gNBQrtlSiMTBvDw34dU77VvcuCNgk5ZxoAaDd/-2024-09-26-05-50-28.mp4",
"color": "#00FF00",
"fps": 0,
"input_video": "https://replicate.delivery/pbxt/LmCPnIRa9EXdXvlnO0Ueq2gKh2jzCWkwzigdXSUMBStQX5Oh/videoplayback%20%28online-video-cutter.com%29%20%281%29.mp4",
"video_handling": "loop"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "jf4e4c6tf1rgm0cjfewb1e32r4",
"model": "tahercoolguy/video_background_remover_appender",
"version": "7f43046e67290923eb7ea9f1b5d15e9feb4e9f047b61dd008ec2d205718328af",
"input": {
"bg_type": "Video",
"bg_video": "https://replicate.delivery/pbxt/LmCPnNpvVF2gNBQrtlSiMTBvDw34dU77VvcuCNgk5ZxoAaDd/-2024-09-26-05-50-28.mp4",
"color": "#00FF00",
"fps": 0,
"input_video": "https://replicate.delivery/pbxt/LmCPnIRa9EXdXvlnO0Ueq2gKh2jzCWkwzigdXSUMBStQX5Oh/videoplayback%20%28online-video-cutter.com%29%20%281%29.mp4",
"video_handling": "loop"
},
"logs": "Moviepy - Building video /tmp/output.mp4.\nMoviePy - Writing audio in outputTEMP_MPY_wvf_snd.mp3\nchunk: 0%| | 0/90 [00:00<?, ?it/s, now=None]\nMoviePy - Done.\nMoviepy - Writing video /tmp/output.mp4\nt: 0%| | 0/98 [00:00<?, ?it/s, now=None]\nt: 27%|██▋ | 26/98 [00:00<00:00, 256.71it/s, now=None]\nt: 53%|█████▎ | 52/98 [00:00<00:00, 253.65it/s, now=None]\nt: 80%|███████▉ | 78/98 [00:00<00:00, 252.89it/s, now=None]\nMoviepy - Done !\nMoviepy - video ready /tmp/output.mp4",
"output": "https://replicate.delivery/pbxt/zPfBVkGmElx2FK98Q5gIeZTp6fuxVQZRaHW9IVDcjNdX9aLnA/output.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-10-11T13:16:05.112Z",
"started_at": "2024-10-11T13:18:05.450005Z",
"completed_at": "2024-10-11T13:18:36.655717Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/jf4e4c6tf1rgm0cjfewb1e32r4/cancel",
"get": "https://api.replicate.com/v1/predictions/jf4e4c6tf1rgm0cjfewb1e32r4",
"web": "https://replicate.com/p/jf4e4c6tf1rgm0cjfewb1e32r4"
},
"metrics": {
"predict_time": 31.205711317,
"total_time": 151.543717
}
}