typetext
{
"duration": 20,
"generate_audio": true,
"prompt": "A scene from the sitcom Friends",
"resolution": "1080p"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_6IU**********************************
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 lightricks/ltx-2-fast using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
duration: 20,
generate_audio: true,
prompt: "A scene from the sitcom Friends",
resolution: "1080p"
};
const output = await replicate.run("lightricks/ltx-2-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_6IU**********************************
This is your API token. Keep it to yourself.
import replicate
Run lightricks/ltx-2-fast using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lightricks/ltx-2-fast",
input={
"duration": 20,
"generate_audio": True,
"prompt": "A scene from the sitcom Friends",
"resolution": "1080p"
}
)
# 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_6IU**********************************
This is your API token. Keep it to yourself.
Run lightricks/ltx-2-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": {
"duration": 20,
"generate_audio": true,
"prompt": "A scene from the sitcom Friends",
"resolution": "1080p"
}
}' \
https://api.replicate.com/v1/models/lightricks/ltx-2-fast/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "sn73045ws1rma0ct6pcbxbvc6c",
"model": "lightricks/ltx-2-fast",
"version": "hidden",
"input": {
"duration": 20,
"generate_audio": true,
"prompt": "A scene from the sitcom Friends",
"resolution": "1080p"
},
"logs": "Using resolution: 1920x1080 (16:9 @ 1080p)\nGenerating video from text...\nGenerated video in 123.1sec\nGenerated video: 1920x1080, 20.20s, 1,003,622,400 total pixels",
"output": "https://replicate.delivery/xezq/LbdpuiJIetUGQiNR4YLcpxwFmYu8q3wAsRw9RH2ZYJhGbJyKA/tmpmn4obie2.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-10-30T14:49:53.608Z",
"started_at": "2025-10-30T14:49:53.622486Z",
"completed_at": "2025-10-30T14:51:57.9565Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/sn73045ws1rma0ct6pcbxbvc6c/cancel",
"get": "https://api.replicate.com/v1/predictions/sn73045ws1rma0ct6pcbxbvc6c",
"stream": "https://stream.replicate.com/v1/files/bcwr-ktjktcangrfelhrgtnm46xrr6fa2lzwijmj47liekvwsonfe6wga",
"web": "https://replicate.com/p/sn73045ws1rma0ct6pcbxbvc6c"
},
"metrics": {
"predict_time": 124.334014513,
"total_time": 124.348500796
}
}