typefile
{
"duration": 10,
"enable_prompt_expansion": true,
"image": "https://replicate.delivery/pbxt/NlpRMC72jJ4uWKowsRSlRgubC6wU8Gl7Nz815XwhkiGPLDPA/replicate-sailor.jpg",
"negative_prompt": "",
"prompt": "A medium shot frames an old sailor, his knitted blue sailor hat casting a shadow over his eyes, a thick grey beard obscuring his chin. He holds his pipe in one hand, gesturing with it towards the churning, grey sea beyond the ship's railing. \"This ocean, it's a force, a wild, untamed might. And she commands your awe, with every breaking light\"",
"resolution": "720p"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_eRI**********************************
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 wan-video/wan-2.5-i2v using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
duration: 10,
enable_prompt_expansion: true,
image: "https://replicate.delivery/pbxt/NlpRMC72jJ4uWKowsRSlRgubC6wU8Gl7Nz815XwhkiGPLDPA/replicate-sailor.jpg",
negative_prompt: "",
prompt: "A medium shot frames an old sailor, his knitted blue sailor hat casting a shadow over his eyes, a thick grey beard obscuring his chin. He holds his pipe in one hand, gesturing with it towards the churning, grey sea beyond the ship's railing. \"This ocean, it's a force, a wild, untamed might. And she commands your awe, with every breaking light\"",
resolution: "720p"
};
const output = await replicate.run("wan-video/wan-2.5-i2v", { 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_eRI**********************************
This is your API token. Keep it to yourself.
import replicate
Run wan-video/wan-2.5-i2v using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"wan-video/wan-2.5-i2v",
input={
"duration": 10,
"enable_prompt_expansion": True,
"image": "https://replicate.delivery/pbxt/NlpRMC72jJ4uWKowsRSlRgubC6wU8Gl7Nz815XwhkiGPLDPA/replicate-sailor.jpg",
"negative_prompt": "",
"prompt": "A medium shot frames an old sailor, his knitted blue sailor hat casting a shadow over his eyes, a thick grey beard obscuring his chin. He holds his pipe in one hand, gesturing with it towards the churning, grey sea beyond the ship's railing. \"This ocean, it's a force, a wild, untamed might. And she commands your awe, with every breaking light\"",
"resolution": "720p"
}
)
# 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_eRI**********************************
This is your API token. Keep it to yourself.
Run wan-video/wan-2.5-i2v 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": {
"duration": 10,
"enable_prompt_expansion": true,
"image": "https://replicate.delivery/pbxt/NlpRMC72jJ4uWKowsRSlRgubC6wU8Gl7Nz815XwhkiGPLDPA/replicate-sailor.jpg",
"negative_prompt": "",
"prompt": "A medium shot frames an old sailor, his knitted blue sailor hat casting a shadow over his eyes, a thick grey beard obscuring his chin. He holds his pipe in one hand, gesturing with it towards the churning, grey sea beyond the ship\'s railing. \\"This ocean, it\'s a force, a wild, untamed might. And she commands your awe, with every breaking light\\"",
"resolution": "720p"
}
}' \
https://api.replicate.com/v1/models/wan-video/wan-2.5-i2v/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "pgez8zj30srme0csfnntv3pvvr",
"model": "wan-video/wan-2.5-i2v",
"version": "hidden",
"input": {
"duration": 10,
"enable_prompt_expansion": true,
"image": "https://replicate.delivery/pbxt/NlpRMC72jJ4uWKowsRSlRgubC6wU8Gl7Nz815XwhkiGPLDPA/replicate-sailor.jpg",
"negative_prompt": "",
"prompt": "A medium shot frames an old sailor, his knitted blue sailor hat casting a shadow over his eyes, a thick grey beard obscuring his chin. He holds his pipe in one hand, gesturing with it towards the churning, grey sea beyond the ship's railing. \"This ocean, it's a force, a wild, untamed might. And she commands your awe, with every breaking light\"",
"resolution": "720p"
},
"logs": "Using seed: 2062825861\nWarning: Moderation check failed: Error code: 429 - {'error': {'message': 'Too Many Requests', 'type': 'invalid_request_error', 'param': None, 'code': None}}\nGenerating...\nGenerated content in 474.9sec\nDownloading 5781796 bytes\nDownloaded 5.51MB in 1.81sec",
"output": "https://replicate.delivery/xezq/P33ke99FZTTWDKYainJQXizgxr7NxAMBYlK4QemCm0dsigYVA/tmp1l37lz4s.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-09-24T20:30:05.574Z",
"started_at": "2025-09-24T20:30:05.581938Z",
"completed_at": "2025-09-24T20:38:04.295262Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/pgez8zj30srme0csfnntv3pvvr/cancel",
"get": "https://api.replicate.com/v1/predictions/pgez8zj30srme0csfnntv3pvvr",
"stream": "https://stream.replicate.com/v1/files/bcwr-t7lzfv4v4wmz5jzwg6hzawjz2awffc7cvoz4pun5q7cjjlh7bhpa",
"web": "https://replicate.com/p/pgez8zj30srme0csfnntv3pvvr"
},
"metrics": {
"predict_time": 478.713323892,
"total_time": 478.721262
}
}