typefile
{
"ad_style": "organic, earthy, modern, sunny",
"num_prompts": 3,
"product_description": "makeup foundation",
"product_image": "https://replicate.delivery/pbxt/NZODJk65UomWpAkcVSM7pWzHecXmMqMUakR7l8XkQ4myz3vR/51GZNSqQw%2BL._UF1000%2C1000_QL80_.jpg",
"target_audience": "women",
"video_duration": 5
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_A0h**********************************
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 pipeline-examples/video-ads using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
ad_style: "organic, earthy, modern, sunny",
num_prompts: 3,
product_description: "makeup foundation",
product_image: "https://replicate.delivery/pbxt/NZODJk65UomWpAkcVSM7pWzHecXmMqMUakR7l8XkQ4myz3vR/51GZNSqQw%2BL._UF1000%2C1000_QL80_.jpg",
target_audience: "women",
video_duration: 5
};
for await (const event of replicate.stream("pipeline-examples/video-ads", { input })) {
process.stdout.write(event.toString());
};
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_A0h**********************************
This is your API token. Keep it to yourself.
import replicate
Run pipeline-examples/video-ads using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
# The pipeline-examples/video-ads model can stream output as it's running.
for event in replicate.stream(
"pipeline-examples/video-ads",
input={
"ad_style": "organic, earthy, modern, sunny",
"num_prompts": 3,
"product_description": "makeup foundation",
"product_image": "https://replicate.delivery/pbxt/NZODJk65UomWpAkcVSM7pWzHecXmMqMUakR7l8XkQ4myz3vR/51GZNSqQw%2BL._UF1000%2C1000_QL80_.jpg",
"target_audience": "women",
"video_duration": 5
},
):
print(str(event), end="")
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_A0h**********************************
This is your API token. Keep it to yourself.
Run pipeline-examples/video-ads 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": {
"ad_style": "organic, earthy, modern, sunny",
"num_prompts": 3,
"product_description": "makeup foundation",
"product_image": "https://replicate.delivery/pbxt/NZODJk65UomWpAkcVSM7pWzHecXmMqMUakR7l8XkQ4myz3vR/51GZNSqQw%2BL._UF1000%2C1000_QL80_.jpg",
"target_audience": "women",
"video_duration": 5
}
}' \
https://api.replicate.com/v1/models/pipeline-examples/video-ads/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "dfv2y7x9pdrma0crs3mt26nf0g",
"model": "pipeline-examples/video-ads",
"version": "hidden",
"input": {
"ad_style": "organic, earthy, modern, sunny",
"num_prompts": 3,
"product_description": "makeup foundation",
"product_image": "https://replicate.delivery/pbxt/NZODJk65UomWpAkcVSM7pWzHecXmMqMUakR7l8XkQ4myz3vR/51GZNSqQw%2BL._UF1000%2C1000_QL80_.jpg",
"target_audience": "women",
"video_duration": 5
},
"logs": "Generated advertising prompts:\n1. Transform the foundation bottle into a sunlit morning skincare ritual scene on a modern marble bathroom counter surrounded by fresh eucalyptus branches, organic cotton towels, and natural sunlight streaming through sheer linen curtains. The foundation should be prominently displayed with golden hour lighting creating warm shadows, while dewdrops on green leaves suggest freshness and natural beauty. Composition should be clean and minimalist with earthy beige and white tones.\n2. Place the Sephora Best Skin Ever foundation as the centerpiece of an outdoor beauty setup on a weathered wooden table in a sun-drenched garden terrace. Surround it with terracotta planters containing succulents, organic cotton makeup brushes in a woven basket, and scattered wildflowers. Natural sunlight should create beautiful dappled lighting through overhead foliage, emphasizing the product's natural coverage promise with warm, earthy tones and modern boho styling.\n3. Create a modern wellness flat lay featuring the foundation bottle on a organic linen fabric backdrop in warm cream tones, surrounded by natural elements like smooth river stones, dried pampas grass, a small wooden mirror, and fresh green leaves. Use bright, diffused natural lighting from above to create soft shadows and highlight the product's sleek design. The composition should feel modern and spa-like with clean lines and earthy textures that appeal to conscious beauty consumers.\nStarting parallel image generation...\nStarted generation 1/3\nStarted generation 2/3\nStarted generation 3/3\nCollecting results...\nCompleted ad image 1/3\nImage path for ad 1: /tmp/cog-runner-tmp-3712339536/177808150d82d925/tmpothhuv47.jpg\nCompleted ad image 2/3\nImage path for ad 2: /tmp/cog-runner-tmp-3712339536/079ad1377527d00b/tmpu0grcxzg.jpg\nCompleted ad image 3/3\nImage path for ad 3: /tmp/cog-runner-tmp-3712339536/8242cfe28a0a5f00/tmphv1xmz66.jpg\nStarting animation process...\nAnimation prompt for ad 1: Animate this image to create a dynamic ad with engaging movement (don't pick up the product, just make it have some compelling, subtle movement (like make it hover, make it glow, make it flip, etc.))\nStarting animation generation for ad 1...\nUsing image for seedance: /tmp/cog-runner-tmp-3712339536/177808150d82d925/tmpothhuv47.jpg\nStarted animation 1/3\nAnimation prompt for ad 2: Animate this image to create a dynamic ad with engaging movement (don't pick up the product, just make it have some compelling, subtle movement (like make it hover, make it glow, make it flip, etc.))\nStarting animation generation for ad 2...\nUsing image for seedance: /tmp/cog-runner-tmp-3712339536/079ad1377527d00b/tmpu0grcxzg.jpg\nStarted animation 2/3\nAnimation prompt for ad 3: Animate this image to create a dynamic ad with engaging movement (don't pick up the product, just make it have some compelling, subtle movement (like make it hover, make it glow, make it flip, etc.))\nStarting animation generation for ad 3...\nUsing image for seedance: /tmp/cog-runner-tmp-3712339536/8242cfe28a0a5f00/tmphv1xmz66.jpg\nStarted animation 3/3\nCollecting animated results...\nCompleted animated ad 1/3\nCompleted animated ad 2/3\nCompleted animated ad 3/3",
"output": [
"https://replicate.delivery/xezq/onEKv3gA3NIFHJkTXW3qikfgEUlcC16gfquDlnKb8jsxF9MVA/tmppfs9c10e.mp4",
"https://replicate.delivery/xezq/B4YGbdcvtK5YGxhSDjpKogXPjENqEnlx7HAzsv5EGlBnRPTF/tmpu084b_jq.mp4",
"https://replicate.delivery/xezq/9WeTzPQW9pQ4PSKAviOanOlfWDybmXtbgo6PejNvzIy6M6ZqA/tmpq4esh87r.mp4"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-20T19:16:53.299Z",
"started_at": "2025-08-20T19:16:53.671353Z",
"completed_at": "2025-08-20T19:18:53.719164Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/dfv2y7x9pdrma0crs3mt26nf0g/cancel",
"children": "https://api.replicate.com/v1/predictions/dfv2y7x9pdrma0crs3mt26nf0g/children",
"get": "https://api.replicate.com/v1/predictions/dfv2y7x9pdrma0crs3mt26nf0g",
"root": "https://api.replicate.com/v1/predictions/dfv2y7x9pdrma0crs3mt26nf0g",
"stream": "https://stream.replicate.com/v1/files/bcwr-spbud5uqab2ipmcwqesgqassncgzt7czqlca343usgiqcc4y33fa",
"web": "https://replicate.com/p/dfv2y7x9pdrma0crs3mt26nf0g"
},
"metrics": {
"predict_time": 120.047811213,
"total_time": 120.420164
}
}