typetext
{
"aspect_ratio": "16:9",
"frames_per_second": 24,
"go_fast": true,
"image": "https://replicate.delivery/xezq/IlV5GMzis46WMBfIPABq8REznOx8fUlyXHBiKS9DwFzJPbXVA/out-0.webp",
"num_frames": 121,
"optimize_prompt": true,
"prompt": "dog talks about their day in a scottish accent",
"resolution": "720p",
"sample_shift": 12
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_6x1**********************************
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.2-5b-fast using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "16:9",
frames_per_second: 24,
go_fast: true,
image: "https://replicate.delivery/xezq/IlV5GMzis46WMBfIPABq8REznOx8fUlyXHBiKS9DwFzJPbXVA/out-0.webp",
num_frames: 121,
optimize_prompt: true,
prompt: "dog talks about their day in a scottish accent",
resolution: "720p",
sample_shift: 12
};
const output = await replicate.run("wan-video/wan-2.2-5b-fast", { 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_6x1**********************************
This is your API token. Keep it to yourself.
import replicate
Run wan-video/wan-2.2-5b-fast using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"wan-video/wan-2.2-5b-fast",
input={
"aspect_ratio": "16:9",
"frames_per_second": 24,
"go_fast": True,
"image": "https://replicate.delivery/xezq/IlV5GMzis46WMBfIPABq8REznOx8fUlyXHBiKS9DwFzJPbXVA/out-0.webp",
"num_frames": 121,
"optimize_prompt": True,
"prompt": "dog talks about their day in a scottish accent",
"resolution": "720p",
"sample_shift": 12
}
)
# 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_6x1**********************************
This is your API token. Keep it to yourself.
Run wan-video/wan-2.2-5b-fast 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": {
"aspect_ratio": "16:9",
"frames_per_second": 24,
"go_fast": true,
"image": "https://replicate.delivery/xezq/IlV5GMzis46WMBfIPABq8REznOx8fUlyXHBiKS9DwFzJPbXVA/out-0.webp",
"num_frames": 121,
"optimize_prompt": true,
"prompt": "dog talks about their day in a scottish accent",
"resolution": "720p",
"sample_shift": 12
}
}' \
https://api.replicate.com/v1/models/wan-video/wan-2.2-5b-fast/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "zst0tg6ec9rmc0csdj3s6a2jfr",
"model": "wan-video/wan-2.2-5b-fast",
"version": "hidden",
"input": {
"aspect_ratio": "16:9",
"frames_per_second": 24,
"go_fast": true,
"image": "https://replicate.delivery/xezq/IlV5GMzis46WMBfIPABq8REznOx8fUlyXHBiKS9DwFzJPbXVA/out-0.webp",
"num_frames": 121,
"optimize_prompt": true,
"prompt": "dog talks about their day in a scottish accent",
"resolution": "720p",
"sample_shift": 12
},
"logs": "initial image size: (1664, 928)\nprocessed image size: (1248, 704)\nInference took 14.03 seconds\nVideo passed safety check with 120 frames",
"output": "https://replicate.delivery/xezq/xevDe1TxQRjK5EefyM4p2APef6lrgJqObmWAfKvjEQxfQQbXVA/output.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-09-21T13:47:43.586Z",
"started_at": "2025-09-21T13:47:43.593149Z",
"completed_at": "2025-09-21T13:48:00.654659Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/zst0tg6ec9rmc0csdj3s6a2jfr/cancel",
"get": "https://api.replicate.com/v1/predictions/zst0tg6ec9rmc0csdj3s6a2jfr",
"stream": "https://stream.replicate.com/v1/files/bcwr-j7utknapbr5nbkttgrh77tp74ztpa7346n7wuy547xpuu76g6yia",
"web": "https://replicate.com/p/zst0tg6ec9rmc0csdj3s6a2jfr"
},
"metrics": {
"predict_time": 17.061509737,
"total_time": 17.068659
}
}