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-restyle-v2v"),
prompt: "Restyle the video into a watercolor painting",
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
promptRequiredType:string
Describe the style you want to apply to the video.
dataRequiredType:File
The video you want to restyle. Supports MP4, WebM, and QuickTime formats up to 100MB.
resolutionOptionalType:string
Output video resolution. (default: 720p) (options: 720p)
Parameter
Type
Required
Description
promptstringYesDescribe the style you want to apply to the video.dataFileYesThe video you want to restyle. Supports MP4, WebM, and QuickTime formats up to 100MB.resolutionstringNoOutput video resolution. (default: 720p) (options: 720p)Lucy Restyle v2v
Long-Form Video Restyling
Apply a new visual style to entire videos - not just short scenes. LSD Long-Form supports videos of any length up to 10 minutes, making it easy to restyle full videos from start to finish in a single workflow.
Pricing
Model
pro
720p
1 Creditsper 1s
Video models are charged per second of generated video. Final cost depends on video duration and selected resolution.