Lucy Motion
Generate videos with object motion following custom trajectories
Generate videos with object motion following custom trajectories
Documentationimport { readFileSync, writeFileSync } from "fs";
import { createDecartClient, models } from "@decartai/sdk";
const client = createDecartClient({
apiKey: "--your-api-key--"
});
const imageBuffer = readFileSync("/path/to/product.jpg");
const imageBlob = new Blob([imageBuffer], { type: "image/jpeg" });
const result = await client.queue.submitAndPoll({
model: models.video("lucy-motion"),
data: imageBlob,
trajectory: [
{ frame: 0, x: 0, y: 0 },
{ frame: 1, x: 0.1, y: 0.2 },
{ frame: 2, x: 0.2, y: 0.4 },
],
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
dataRequiredType:File
Upload an image to animate with a motion trajectory.
trajectoryRequiredType:
Draw the motion path on the image above. The object will follow this trajectory.
Parameter
Type
Required
Description
dataFileYesUpload an image to animate with a motion trajectory.trajectoryYesDraw the motion path on the image above. The object will follow this trajectory.Lucy Motion
Generate a video by selecting an object and drawing its freehand motion path.
Lucy Motion animates images based on a free-form trajectory. It generates a clip where the selected object follows the input trajectory while preserving scene coherence and visual quality. This gives direct, intuitive control over motion in the video.
Pricing
Model
pro
720p
3 Creditsper 1s
Video models are charged per second of generated video. Final cost depends on video duration and selected resolution.