typefile
{
"input_image": "https://replicate.delivery/pbxt/NpoF8KbK5UfbfGDtdhHMfQCw1lgYKBojYPo11ADotgGG0n7Q/replicate-prediction-dy0fjgcpqxrme0cspwf82pgpk4.webp",
"user_description": "a 21 year old male model talks about the importance of smelling good"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_RWt**********************************
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 lucataco/ugc-ad using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
input_image: "https://replicate.delivery/pbxt/NpoF8KbK5UfbfGDtdhHMfQCw1lgYKBojYPo11ADotgGG0n7Q/replicate-prediction-dy0fjgcpqxrme0cspwf82pgpk4.webp",
user_description: "a 21 year old male model talks about the importance of smelling good"
};
const output = await replicate.run("lucataco/ugc-ad", { input });
// 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_RWt**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/ugc-ad using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/ugc-ad",
input={
"input_image": "https://replicate.delivery/pbxt/NpoF8KbK5UfbfGDtdhHMfQCw1lgYKBojYPo11ADotgGG0n7Q/replicate-prediction-dy0fjgcpqxrme0cspwf82pgpk4.webp",
"user_description": "a 21 year old male model talks about the importance of smelling good"
}
)
# 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_RWt**********************************
This is your API token. Keep it to yourself.
Run lucataco/ugc-ad 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": {
"input_image": "https://replicate.delivery/pbxt/NpoF8KbK5UfbfGDtdhHMfQCw1lgYKBojYPo11ADotgGG0n7Q/replicate-prediction-dy0fjgcpqxrme0cspwf82pgpk4.webp",
"user_description": "a 21 year old male model talks about the importance of smelling good"
}
}' \
https://api.replicate.com/v1/models/lucataco/ugc-ad/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "8zbb4qta9nrmc0cspwhrf2n3vg",
"model": "lucataco/ugc-ad",
"version": "hidden",
"input": {
"input_image": "https://replicate.delivery/pbxt/NpoF8KbK5UfbfGDtdhHMfQCw1lgYKBojYPo11ADotgGG0n7Q/replicate-prediction-dy0fjgcpqxrme0cspwf82pgpk4.webp",
"user_description": "a 21 year old male model talks about the importance of smelling good"
},
"logs": "",
"output": "https://replicate.delivery/xezq/jAouwTxzoI5dOhJRl2dLTRswYTORA7xhFtLCNIGMFv0PODXF/tmpga4w7hh4.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-10-06T01:29:27.373Z",
"started_at": "2025-10-06T01:29:27.85897Z",
"completed_at": "2025-10-06T01:32:48.021637Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/8zbb4qta9nrmc0cspwhrf2n3vg/cancel",
"children": "https://api.replicate.com/v1/predictions/8zbb4qta9nrmc0cspwhrf2n3vg/children",
"get": "https://api.replicate.com/v1/predictions/8zbb4qta9nrmc0cspwhrf2n3vg",
"root": "https://api.replicate.com/v1/predictions/8zbb4qta9nrmc0cspwhrf2n3vg",
"stream": "https://stream.replicate.com/v1/files/bcwr-lpmjt5h647yjn5bsgzq665wtgegwpgy3kbprskwhfdowmkkslzya",
"web": "https://replicate.com/p/8zbb4qta9nrmc0cspwhrf2n3vg"
},
"metrics": {
"predict_time": 200.162667663,
"total_time": 200.648637
}
}