Lucy
Long-Form Video Editing
import { readFileSync, writeFileSync } from "fs";
import { createDecartClient, models } from "@decartai/sdk";
const client = createDecartClient({
apiKey: "--your-api-key--"
});
const videoBuffer = readFileSync("/path/to/input.mp4");
const videoBlob = new Blob([videoBuffer], { type: "video/mp4" });
const result = await client.queue.submitAndPoll({
model: models.video("lucy-2.1"),
prompt: "Change the person's outfit to a red dress",
data: videoBlob,
onStatusChange: (job) => console.log(`Status: ${job.status}`),
});
if (result.status === "completed") {
const buffer = Buffer.from(await result.data.arrayBuffer());
writeFileSync("output.mp4", buffer);
}Available Endpoints
Request Parameters
promptOptionalType:string
Describe the edits you want to apply to the video.
reference_imageOptionalType:File
Upload a reference image to guide the edit.
dataRequiredType:File
The video you want to edit. Supports MP4, WebM, and QuickTime formats up to 300MB.
resolutionOptionalType:string
Output video resolution. (default: 720p) (options: 720p)
Parameter
Type
Required
Description
promptstringNoDescribe the edits you want to apply to the video.reference_imageFileNoUpload a reference image to guide the edit.dataFileYesThe video you want to edit. Supports MP4, WebM, and QuickTime formats up to 300MB.resolutionstringNoOutput video resolution. (default: 720p) (options: 720p)Lucy
Long-Form Video Editing
Edit entire videos with text prompts and optional reference images. Lucy supports videos up to 30 minutes, making it easy to edit full videos from start to finish in a single workflow.
Pricing
Model
v2.1
720p
4 Creditsper 1s
Video models are charged per second of generated video. Final cost depends on video duration and selected resolution.