typetext
{
"aspect_ratio": "9:16",
"duration": 5,
"motion_mode": "smooth",
"negative_prompt": "",
"prompt": "a tiktok dancer",
"quality": "720p",
"style": "None"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_dwl**********************************
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 pixverse/pixverse-v4 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "9:16",
duration: 5,
motion_mode: "smooth",
negative_prompt: "",
prompt: "a tiktok dancer",
quality: "720p",
style: "None"
};
const output = await replicate.run("pixverse/pixverse-v4", { 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_dwl**********************************
This is your API token. Keep it to yourself.
import replicate
Run pixverse/pixverse-v4 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"pixverse/pixverse-v4",
input={
"aspect_ratio": "9:16",
"duration": 5,
"motion_mode": "smooth",
"negative_prompt": "",
"prompt": "a tiktok dancer",
"quality": "720p",
"style": "None"
}
)
# 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_dwl**********************************
This is your API token. Keep it to yourself.
Run pixverse/pixverse-v4 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": "9:16",
"duration": 5,
"motion_mode": "smooth",
"negative_prompt": "",
"prompt": "a tiktok dancer",
"quality": "720p",
"style": "None"
}
}' \
https://api.replicate.com/v1/models/pixverse/pixverse-v4/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "n7e6n2031nrm80cpnjw9jr75mr",
"model": "pixverse/pixverse-v4",
"version": "hidden",
"input": {
"aspect_ratio": "9:16",
"duration": 5,
"motion_mode": "smooth",
"negative_prompt": "",
"prompt": "a tiktok dancer",
"quality": "720p",
"style": "None"
},
"logs": "Using seed: 413298086\nModerating content...\nModeration complete in 0.31sec\nGenerating video...\nGenerated video in 42.3sec\nDownloading 1827112 bytes\nDownloaded 1.74MB in 0.51sec\nCost calculation:\n Base units for 720p: 60\n Motion multiplier (smooth = 2x): 2\n Calculation: 60 × 2 = 120\n---------------------------\nTotal units: 120\n---------------------------",
"output": "https://replicate.delivery/xezq/SgfIZjrFaeuPlkC8qkwnCUYVa7rwzCHRacKIw9d3cFeS5wUpA/tmpf6s4mkge.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-05-07T21:47:42.733Z",
"started_at": "2025-05-07T21:47:42.741968Z",
"completed_at": "2025-05-07T21:48:25.85694Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/n7e6n2031nrm80cpnjw9jr75mr/cancel",
"get": "https://api.replicate.com/v1/predictions/n7e6n2031nrm80cpnjw9jr75mr",
"stream": "https://stream.replicate.com/v1/files/bcwr-hflh2tzmsoiimfwebmyv4y4ijdoc5samk2iksbvn6v4ft6dyt7ka",
"web": "https://replicate.com/p/n7e6n2031nrm80cpnjw9jr75mr"
},
"metrics": {
"predict_time": 43.11497269,
"total_time": 43.12394
}
}