{
"avatar_image": "https://replicate.delivery/xezq/tf53YDl4pyTaJKUyRWl5HPtLaAWWxQfa1TgdSDue1Eh2ejGWB/tmp24satewl.jpg",
"avatar_size_percent": 25,
"corner": "bottom-right",
"input_video": "https://replicate.delivery/pbxt/NvgikjEiaSAd9LFvwNdCwVg37lS6x4h7t1NqfjgCEnKE47td/replicate-tutorial.mp4"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Ota**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run andreasjansson/baby-in-a-corner using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
avatar_image: "https://replicate.delivery/xezq/tf53YDl4pyTaJKUyRWl5HPtLaAWWxQfa1TgdSDue1Eh2ejGWB/tmp24satewl.jpg",
avatar_size_percent: 25,
corner: "bottom-right",
input_video: "https://replicate.delivery/pbxt/NvgikjEiaSAd9LFvwNdCwVg37lS6x4h7t1NqfjgCEnKE47td/replicate-tutorial.mp4"
};
const output = await replicate.run("andreasjansson/baby-in-a-corner", { input });
console.log(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_Ota**********************************
This is your API token. Keep it to yourself.
import replicate
Run andreasjansson/baby-in-a-corner using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"andreasjansson/baby-in-a-corner",
input={
"avatar_image": "https://replicate.delivery/xezq/tf53YDl4pyTaJKUyRWl5HPtLaAWWxQfa1TgdSDue1Eh2ejGWB/tmp24satewl.jpg",
"avatar_size_percent": 25,
"corner": "bottom-right",
"input_video": "https://replicate.delivery/pbxt/NvgikjEiaSAd9LFvwNdCwVg37lS6x4h7t1NqfjgCEnKE47td/replicate-tutorial.mp4"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Ota**********************************
This is your API token. Keep it to yourself.
Run andreasjansson/baby-in-a-corner 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 $'{
"input": {
"avatar_image": "https://replicate.delivery/xezq/tf53YDl4pyTaJKUyRWl5HPtLaAWWxQfa1TgdSDue1Eh2ejGWB/tmp24satewl.jpg",
"avatar_size_percent": 25,
"corner": "bottom-right",
"input_video": "https://replicate.delivery/pbxt/NvgikjEiaSAd9LFvwNdCwVg37lS6x4h7t1NqfjgCEnKE47td/replicate-tutorial.mp4"
}
}' \
https://api.replicate.com/v1/models/andreasjansson/baby-in-a-corner/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Object output with 1 properties
{
"id": "d5bxajmfnnrma0ct1hpr7f31hw",
"model": "andreasjansson/baby-in-a-corner",
"version": "hidden",
"input": {
"avatar_image": "https://replicate.delivery/xezq/tf53YDl4pyTaJKUyRWl5HPtLaAWWxQfa1TgdSDue1Eh2ejGWB/tmp24satewl.jpg",
"avatar_size_percent": 25,
"corner": "bottom-right",
"input_video": "https://replicate.delivery/pbxt/NvgikjEiaSAd9LFvwNdCwVg37lS6x4h7t1NqfjgCEnKE47td/replicate-tutorial.mp4"
},
"logs": "Avatar positioning: size=270, margin=32, shadow_offset=8\nVideo dimensions: 1920x1080, Position: (1610, 770)\nRunning FFmpeg overlay with filter: [1:v]scale=270:270,format=yuva420p,geq=lum='p(X,Y)':a='if(lte(hypot(X-135.0,Y-135.0),135.0),255,0)'[masked];[masked]split[avatar][shadow_base];[shadow_base]geq=lum=0:cb=128:cr=128:a='alpha(X,Y)*0.4'[shadow_dark];[shadow_dark]pad=290:290:10:10:color=black@0[shadow_padded];[shadow_padded]boxblur=10:1[shadow];[0:v][shadow]overlay=1608:768[with_shadow];[with_shadow][avatar]overlay=1610:770\nInput video: /tmp/cog-input-919011688.mp4, Lipsync video: /tmp/concatenated_lipsync.mp4",
"output": {
"video": "https://replicate.delivery/xezq/JrDvsHPoe3QnNyz2y0VoFgx3Ocpy2IaYaolWcnZxKejdPqhVA/final_output.mp4"
},
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-10-22T14:58:18.157Z",
"started_at": "2025-10-22T14:58:18.696816Z",
"completed_at": "2025-10-22T15:01:49.221521Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/d5bxajmfnnrma0ct1hpr7f31hw/cancel",
"children": "https://api.replicate.com/v1/predictions/d5bxajmfnnrma0ct1hpr7f31hw/children",
"get": "https://api.replicate.com/v1/predictions/d5bxajmfnnrma0ct1hpr7f31hw",
"root": "https://api.replicate.com/v1/predictions/d5bxajmfnnrma0ct1hpr7f31hw",
"web": "https://replicate.com/p/d5bxajmfnnrma0ct1hpr7f31hw"
},
"metrics": {
"predict_time": 210.524705323,
"total_time": 211.064521
}
}