typefile
{
"ad_style": "modern and clean",
"num_prompts": 4,
"product_description": "shampoo",
"product_image": "https://replicate.delivery/pbxt/NYxFDmelVmWvLgyJ0KpplHwLtQoTfuEaDBI3onaeqBIxPLHB/coconut-milk-shampoo-13oz-FOP-cloudy-gradient.webp",
"target_audience": "upscale consumers"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_e2o**********************************
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/ads-for-products using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
ad_style: "modern and clean",
num_prompts: 4,
product_description: "shampoo",
product_image: "https://replicate.delivery/pbxt/NYxFDmelVmWvLgyJ0KpplHwLtQoTfuEaDBI3onaeqBIxPLHB/coconut-milk-shampoo-13oz-FOP-cloudy-gradient.webp",
target_audience: "upscale consumers"
};
for await (const event of replicate.stream("pipeline-examples/ads-for-products", { 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_e2o**********************************
This is your API token. Keep it to yourself.
import replicate
Run pipeline-examples/ads-for-products using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
# The pipeline-examples/ads-for-products model can stream output as it's running.
for event in replicate.stream(
"pipeline-examples/ads-for-products",
input={
"ad_style": "modern and clean",
"num_prompts": 4,
"product_description": "shampoo",
"product_image": "https://replicate.delivery/pbxt/NYxFDmelVmWvLgyJ0KpplHwLtQoTfuEaDBI3onaeqBIxPLHB/coconut-milk-shampoo-13oz-FOP-cloudy-gradient.webp",
"target_audience": "upscale consumers"
},
):
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_e2o**********************************
This is your API token. Keep it to yourself.
Run pipeline-examples/ads-for-products 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": "modern and clean",
"num_prompts": 4,
"product_description": "shampoo",
"product_image": "https://replicate.delivery/pbxt/NYxFDmelVmWvLgyJ0KpplHwLtQoTfuEaDBI3onaeqBIxPLHB/coconut-milk-shampoo-13oz-FOP-cloudy-gradient.webp",
"target_audience": "upscale consumers"
}
}' \
https://api.replicate.com/v1/models/pipeline-examples/ads-for-products/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "5wxkwp8gexrme0crrad8c9ww14",
"model": "pipeline-examples/ads-for-products",
"version": "hidden",
"input": {
"ad_style": "modern and clean",
"num_prompts": 4,
"product_description": "shampoo",
"product_image": "https://replicate.delivery/pbxt/NYxFDmelVmWvLgyJ0KpplHwLtQoTfuEaDBI3onaeqBIxPLHB/coconut-milk-shampoo-13oz-FOP-cloudy-gradient.webp",
"target_audience": "upscale consumers"
},
"logs": "Generated advertising prompts:\n1. Transform the OGX coconut milk shampoo bottle into a luxurious spa advertisement by placing it on a pristine white marble countertop in an upscale bathroom setting. Add soft, diffused natural lighting streaming through frosted glass, with subtle reflections on the marble surface. Include minimal spa elements like a single white orchid and fluffy white towels in the background. The composition should be clean and sophisticated with plenty of negative space, emphasizing the premium quality of the product through elegant simplicity.\n2. Create a high-end beauty editorial scene with the shampoo bottle positioned on a sleek glass pedestal against a gradient backdrop transitioning from warm cream to soft gold. Add dramatic side lighting that creates elegant shadows and highlights the golden cap's luxurious finish. Include subtle tropical elements like a single coconut cut in half and drops of coconut milk suspended in mid-air around the bottle, all rendered in a minimalist, modern aesthetic that appeals to discerning consumers.\n3. Design an upscale wellness lifestyle scene with the coconut milk shampoo as the centerpiece on a contemporary floating shelf in a modern walk-in shower. Use clean architectural lines with white subway tiles and brushed gold fixtures. Incorporate soft, even lighting that mimics natural daylight, creating a serene atmosphere. Add minimal elements like a small potted tropical plant and premium loofahs, maintaining a clutter-free, spa-like environment that communicates luxury and self-care.\n4. Craft a sophisticated product showcase by placing the shampoo bottle on a curved white acrylic display stand against a seamless infinity backdrop. Use professional studio lighting with a key light creating gentle highlights on the bottle's curves and a subtle rim light outlining its silhouette. Add floating coconut flakes and milk droplets rendered in a clean, geometric style around the product. The overall composition should feel premium and scientific, emphasizing the advanced formula while maintaining visual elegance.\nStarting parallel image generation...\nStarted generation 1/4\nStarted generation 2/4\nStarted generation 3/4\nStarted generation 4/4\nCollecting results...\nCompleted ad image 1/4\nCompleted ad image 2/4\nCompleted ad image 3/4\nCompleted ad image 4/4",
"output": [
"https://replicate.delivery/xezq/fyL8CYOWJejQB0YRpFO6IK4tHwfWFdnnElfLmcvzPQqL6MyUB/tmpl27bfqqd.jpg",
"https://replicate.delivery/xezq/JNJY75DfXdyMAC7tkbTBSzGLeMs9rgh3Xc1dxMjv98fGdGZqA/tmpq2l60v92.jpg",
"https://replicate.delivery/xezq/n4pnV6i5eUQRVad1F5NDY9ewdT3ROqOjMRWYpssn8zlkOjMVA/tmpd1k04ytv.jpg",
"https://replicate.delivery/xezq/xxoRobeMgO05GyjQeRO67ibQNRQEie0gLfOCkfz3G5Iu0ZkpC/tmp9tu67x61.jpg"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-19T13:52:13.431Z",
"started_at": "2025-08-19T13:52:13.828943Z",
"completed_at": "2025-08-19T13:52:37.418165Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/5wxkwp8gexrme0crrad8c9ww14/cancel",
"children": "https://api.replicate.com/v1/predictions/5wxkwp8gexrme0crrad8c9ww14/children",
"get": "https://api.replicate.com/v1/predictions/5wxkwp8gexrme0crrad8c9ww14",
"root": "https://api.replicate.com/v1/predictions/5wxkwp8gexrme0crrad8c9ww14",
"stream": "https://stream.replicate.com/v1/files/bcwr-rmkmrhap4wlopahgjci6cld2cterniskiwwwivlzq2t5yepkvfmq",
"web": "https://replicate.com/p/5wxkwp8gexrme0crrad8c9ww14"
},
"metrics": {
"predict_time": 23.589221647,
"total_time": 23.987165
}
}
