typetext
{
"add_sound": true,
"animal": "black cat",
"aspect_ratio": "16:9",
"duration": 5,
"quality": "720p",
"style": "realistic"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_PSn**********************************
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 pranavsekhar/animal-to-train using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
add_sound: true,
animal: "black cat",
aspect_ratio: "16:9",
duration: 5,
quality: "720p",
style: "realistic"
};
const output = await replicate.run("pranavsekhar/animal-to-train", { 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_PSn**********************************
This is your API token. Keep it to yourself.
import replicate
Run pranavsekhar/animal-to-train using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"pranavsekhar/animal-to-train",
input={
"add_sound": True,
"animal": "black cat",
"aspect_ratio": "16:9",
"duration": 5,
"quality": "720p",
"style": "realistic"
}
)
# 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_PSn**********************************
This is your API token. Keep it to yourself.
Run pranavsekhar/animal-to-train 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": {
"add_sound": true,
"animal": "black cat",
"aspect_ratio": "16:9",
"duration": 5,
"quality": "720p",
"style": "realistic"
}
}' \
https://api.replicate.com/v1/models/pranavsekhar/animal-to-train/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "017t3wh431rmc0crnb48rcbxfr",
"model": "pranavsekhar/animal-to-train",
"version": "hidden",
"input": {
"add_sound": true,
"animal": "black cat",
"aspect_ratio": "16:9",
"duration": 5,
"quality": "720p",
"style": "realistic"
},
"logs": "",
"output": "https://replicate.delivery/xezq/3AoEVwRlod6cDBJzQfdEOCven81kdQS5mmAI7WMPZpohqBLVA/tmpssayz6qi.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-14T22:51:39.928Z",
"started_at": "2025-08-14T22:51:40.235783Z",
"completed_at": "2025-08-14T22:52:17.8509Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/017t3wh431rmc0crnb48rcbxfr/cancel",
"children": "https://api.replicate.com/v1/predictions/017t3wh431rmc0crnb48rcbxfr/children",
"get": "https://api.replicate.com/v1/predictions/017t3wh431rmc0crnb48rcbxfr",
"root": "https://api.replicate.com/v1/predictions/017t3wh431rmc0crnb48rcbxfr",
"stream": "https://stream.replicate.com/v1/files/bcwr-yve46z7k2nhkziug22oxb26twcijm7zc4rfck7ik3dlmi7vsw3oq",
"web": "https://replicate.com/p/017t3wh431rmc0crnb48rcbxfr"
},
"metrics": {
"predict_time": 37.615117886,
"total_time": 37.9229
}
}