Decart Logo
  • Real-time
  • Lucy Edit Live
    Lucy Edit LiveRealtime Video Editing
  • Lucy Restyle Live
    Lucy Restyle LiveRealtime Video Restyling
  • LipSync Live
    LipSync LiveRealtime Lips movement
  • Avatar Live
    Avatar LiveRealtime Avatar animation
  • Video models
  • Lucy
    LucyText/Image to Video
  • Lucy Edit
    Lucy EditVideo to Video
  • Lucy Edit
    Lucy Edit 2Long Video Editing
  • Lucy Motion
    Lucy MotionImage to Video
  • Lucy Restyle Live
    Lucy RestyleLong Video Restyling
  • Image models
  • Lucy Image
    Lucy ImageText to Image
  • Lucy Image Edit
    Lucy Image EditImage to Image
  • Cookbook icon
    Cookbook
  • Documentation icon
    Documentation
  1. Models
  2. Lucy Motion
Lucy Motion icon

Lucy Motion

Generate videos with object motion following custom trajectories

Generate videos with object motion following custom trajectories

Documentation
Your browser does not support the video tag.
import { 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

dataRequired
Type:File

Upload an image to animate with a motion trajectory.

trajectoryRequired
Type:

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.

Examples