typetext
{
"aspect_ratio": "16:9",
"loop": false,
"prompt": "This video shows the majestic beauty of a waterfall cascading down a cliff into a serene lake. The waterfall, with its powerful flow, is the central focus of the video. The surrounding landscape is lush and green, with trees and foliage adding to the natural beauty of the scene"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_RhK**********************************
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 luma/ray using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "16:9",
loop: false,
prompt: "This video shows the majestic beauty of a waterfall cascading down a cliff into a serene lake. The waterfall, with its powerful flow, is the central focus of the video. The surrounding landscape is lush and green, with trees and foliage adding to the natural beauty of the scene"
};
const output = await replicate.run("luma/ray", { 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_RhK**********************************
This is your API token. Keep it to yourself.
import replicate
Run luma/ray using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"luma/ray",
input={
"aspect_ratio": "16:9",
"loop": False,
"prompt": "This video shows the majestic beauty of a waterfall cascading down a cliff into a serene lake. The waterfall, with its powerful flow, is the central focus of the video. The surrounding landscape is lush and green, with trees and foliage adding to the natural beauty of the scene"
}
)
# 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_RhK**********************************
This is your API token. Keep it to yourself.
Run luma/ray 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",
"loop": false,
"prompt": "This video shows the majestic beauty of a waterfall cascading down a cliff into a serene lake. The waterfall, with its powerful flow, is the central focus of the video. The surrounding landscape is lush and green, with trees and foliage adding to the natural beauty of the scene"
}
}' \
https://api.replicate.com/v1/models/luma/ray/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "qnjvm3qyqxrge0ckqeyrts7cg4",
"model": "luma/ray",
"version": "hidden",
"input": {
"aspect_ratio": "16:9",
"loop": false,
"prompt": "This video shows the majestic beauty of a waterfall cascading down a cliff into a serene lake. The waterfall, with its powerful flow, is the central focus of the video. The surrounding landscape is lush and green, with trees and foliage adding to the natural beauty of the scene"
},
"logs": "Moderating content...\nModeration complete in 0.27sec\nRunning prediction... \nGenerating video...\nDATA: {'prompt': 'This video shows the majestic beauty of a waterfall cascading down a cliff into a serene lake. The waterfall, with its powerful flow, is the central focus of the video. The surrounding landscape is lush and green, with trees and foliage adding to the natural beauty of the scene', 'aspect_ratio': '16:9', 'loop': False}\nDreaming...\nCompleted...\nGenerated video in 37.54sec\nVIDEO_GENERATION_ID: 83bfbd54-83a9-48d9-808c-43f4289018f7\nDownloading 2813035 bytes\nDownloaded 2.68MB in 0.46sec",
"output": "https://replicate.delivery/czjl/j9Fz1tqiiK7QFZfQlPKjYxUYcTRx64QGnM4XhUUVdBtIIG9JA/tmpvq1ddzt7.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-12-12T16:40:11.199Z",
"started_at": "2024-12-12T16:40:11.207312Z",
"completed_at": "2024-12-12T16:40:49.541614Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/qnjvm3qyqxrge0ckqeyrts7cg4/cancel",
"get": "https://api.replicate.com/v1/predictions/qnjvm3qyqxrge0ckqeyrts7cg4",
"stream": "https://stream.replicate.com/v1/files/fddq-jbd36htnsp46ylttbjaxyambx2zperno4cz47y3ubwug735pvp3q",
"web": "https://replicate.com/p/qnjvm3qyqxrge0ckqeyrts7cg4"
},
"metrics": {
"predict_time": 38.334302006,
"total_time": 38.342614
}
}