Lucy Edit icon

Lucy Edit

Edit video in realtime with controlled, targeted prompts

Documentation
2 credits per second

Input

Press play to start with camera

Output

Decart Logo
albert-stylestein.jpeg
import { createDecartClient, models } from "@decartai/sdk";

const model = models.realtime("lucy-2.1");

// Get user's camera stream with model specifications
const stream = await navigator.mediaDevices.getUserMedia({
  audio: true,
  video: {
    frameRate: model.fps,
    width: model.width,
    height: model.height,
  }
});

// Create a client
const client = createDecartClient({
  apiKey: "your-api-key-here"
});

// Connect and edit the video stream
const realtimeClient = await client.realtime.connect(stream, {
  model,
  onRemoteStream: (editedStream) => {
    // Display the edited video
    const videoElement = document.querySelector("#video-output");
    videoElement.srcObject = editedStream;
  }
});

// set() replaces the full state — prompt + image atomically
await realtimeClient.set({
  prompt: "A person wearing a superhero costume",
  enhance: true,
  image: "https://example.com/superhero-reference.png",
});

// Prompt-only update
await realtimeClient.set({ prompt: "Add sunglasses to the person" });

// setPrompt() also works as a shorthand
await realtimeClient.setPrompt("Change the person's shirt to red");

// Disconnect when done
realtimeClient.disconnect();

Available Endpoints

Request Parameters

promptRequired
Type:string

Edit description for live transformation

streamRequired
Type:File

Video stream (WebRTC)

Lucy Edit

Edit video in realtime with controlled, targeted prompts

Lucy Edit enables targeted video edits, modifying specific elements while preserving the rest. Edit infinite long videos in realtime, with zero latency, and see your changes as you type.

Pricing

Model
v1
720p
1 Creditsper 1s
Model
v2
720p
2 Creditsper 1s
Model
v2.1
720p
2 Creditsper 1s
Model
v2.1-vton
720p
2 Creditsper 1s

Video models are charged per second of generated video. Final cost depends on video duration and selected resolution.

Examples

Decart API Platform