Limited-time Thanksgiving offer · 50% off platform fees for new users’ first 7 days (1.25% instead of 2.5%). Sign up by Dec 1. Sign up now → Details
Discord
Decart Lucy is unavailable. Every Lucy model on this page has been offline since 2026-11-28: starting a session returns 503 provider_disabled, so the examples below do not run. Use the other realtime video editing models.

Lucy real-time video editing

Lucy (by Decart) edits a live camera or video stream as it plays: swap characters, add, replace or remove things, change the background, restyle the picture, or try on clothes. Your server mints a token, and your user's browser streams to the host with short-lived credentials. Every Lucy model uses the same code: only the model id changes.

Model idUse it forBrowser packagePriceOutput
decart/lucy-2.6General editing (latest)@decartai/sdk$0.0205/s (fast $0.0410/s)720p
decart/lucy-2.5General editing@decartai/sdk$0.0205/s (fast $0.0410/s)720p
decart/lucy-2.1General editing (previous generation)@decartai/sdk$0.0205/s720p
decart/lucy-vton-3.6Virtual try-on (latest)@decartai/sdk$0.0205/s (fast $0.0410/s)720p
decart/lucy-vton-3.5Virtual try-on@decartai/sdk$0.0205/s (fast $0.0410/s)720p
decart/lucy-restyle-2Restyle the whole picture@decartai/sdk$0.0102/s704p
decart/lucy-2.6/falLucy 2.6, second hostnone$0.0205/s720p
decart/lucy-2.5/falLucy 2.5, second hostnone$0.0205/s720p
fal/lucy-vton-2.1-webrtcTry-on (previous generation), second hostnone$0.0205/s720p

Prices include the platform fee and can change; GET /v1/live-video/models is the live list, and a model whose host is unavailable may not be offered. A session lasts 10 to 600 seconds (default 120). Booking holds price × maxDurationSeconds; you pay for the seconds the host meters, and the rest is released. A session that never starts generating costs nothing.

Test status: as of 2026-11-27 we have not run the Lucy models through RealtimeEditModel against a live host session. The code on this page is tested against simulated hosts only, so test your integration before you rely on it.

Quickstart

Install

npm install videorouter-live @decartai/sdk      # the fal rows need no extra package

RealtimeEditModel and lv.upload() need videorouter-live 0.3.0 or newer. The page must be served over HTTPS or localhost, and the camera must be requested from a user action. Inside an iframe, allow it: <iframe allow="camera; autoplay">.

1. Mint a browser token on your server

curl https://videorouter.sh/api/v1/live-video/tokens \
  -H "Authorization: Bearer $VIDEOROUTER_API_KEY" -H "Content-Type: application/json" \
  -d '{"models": ["decart/lucy-2.6", "decart/lucy-2.6/fal"], "expires_in": 3600, "max_sessions": 1, "max_session_duration_seconds": 300}'
# -> {"token": "...", "expires_at": "...", ...}      send "token" to the browser, never your API key

List every model id your page may use. For failover on Lucy 2.6 or 2.5, list both hosts.

2. Connect and edit

import { RealtimeEditModel } from "videorouter-live";
import * as decart from "@decartai/sdk";

const model = new RealtimeEditModel({ model: "decart/lucy-2.6", maxDurationSeconds: 300, hostSdk: { decart } });
await model.connect(token);

const camera = await navigator.mediaDevices.getUserMedia({ video: { width: 1280, height: 720, frameRate: 30 } });
await model.start(camera, {
  prompt: "Add a red knit beanie to the person's head",
  onRemoteStream: (stream) => (video.srcObject = stream),     // <video autoplay playsinline>
  onState: ({ host, state }) => console.log(host, state),
  onError: (error) => console.error(error),                    // the stream failed after it had started
});

await model.setPrompt("Set the background to a tropical beach with palm trees");   // change it while it runs
await model.end();                                             // stops the stream and settles the bill

Send the camera at 1280×720 and 30 fps (1280×704 for decart/lucy-restyle-2). start() takes any MediaStream with a video track, such as a camera, a canvas or a playing video; audio is not sent. end() also stops its tracks. The session heartbeat is sent for you.

Reference images

A reference image shows Lucy what to put in the picture: a character, a garment, an object or a style. Pass a File, Blob, data URI or image URL as image, at the start or at any time after. A file is handled for you; you never upload to a model host.

await model.start(camera, { prompt: "Substitute the person with the character in the reference image", image: file, onRemoteStream });

await model.setPrompt("Same character, standing in the rain");     // the image is kept
await model.setPrompt(undefined, { image: anotherFile });         // new image, the text is kept

RealtimeEditModel keeps the part you do not change. (Decart's own set() replaces both at once.)

To upload once and reuse the link, use VideoRouter's upload, which works with the browser token: const { url } = await lv.upload(file), or POST /v1/uploads. The link lives 30 minutes.

Image ruleRecommendation
FormatJPEG, PNG or WebP
SizeAt least 512×512 (required on the fal rows); under about 5 MB uploads quickly
CharacterOne clear, well-lit, front-facing face, head and shoulders
GarmentThe item alone on a plain or white background, not worn by someone

Virtual try-on

Use decart/lucy-vton-3.6 (or 3.5). Give a garment image, a sentence that names what to change, or both; both together gives the clearest signal.

const model = new RealtimeEditModel({ model: "decart/lucy-vton-3.6", hostSdk: { decart } });
await model.connect(token);                                       // a token that allows "decart/lucy-vton-3.6"
await model.start(camera, {
  image: garmentFile,
  prompt: "Substitute the upper body garment with a black bomber jacket with a blue chest logo and a zip front",
  enhance: false,                                                  // keep your wording
  onRemoteStream,
});
await model.setPrompt("Substitute the upper body garment with a grey crewneck sweatshirt", { image: nextGarment });
ChangingPrompt pattern
Tops, jackets, hoodies, sweatersSubstitute the upper body garment with <description>.
Pants, skirts, shortsSubstitute the lower body garment with <description>.
Dresses, sets, full looksSubstitute the outfit with <description>.
Shoes / hat / necklaceSubstitute the footwear (hat, necklace) with <description>.
Accessories to addAdd <description> to the outfit.

Use one action per prompt, and describe only what is visible in the garment image: color, fabric, fit, sleeves, neckline, closures and pattern. Ask for no unrelated changes.

fal/lucy-vton-2.1-webrtc takes the same calls. Always pass your own prompt and image to it.

Writing edit prompts

Start with the action, then name the target and what it should become. These patterns are Decart's recommendations for Lucy 2.6.

EditExample
Substitute (replace a person)Substitute the man with a cartoon astronaut in a white spacesuit with a gold visor.
AddAdd a red knit beanie to the woman's head.
Swap clothes, same personSwap the man's gray hoodie for a navy denim jacket with brass buttons.
BackgroundSet the background to a tropical beach with white sand and palm trees.
RemoveRemove the red backpack from the floor near the sofa.
Change an attributeMake the silver headphones metallic gold.
Restyle everythingRestyle the entire scene as a colorful comic book with bold black outlines.

enhance (on by default) lets Decart expand your prompt. If you turn it off, write two sentences: the command, then one that starts with “The output will show” and describes the result.

decart/lucy-restyle-2 restyles the whole picture. Describe the style ("Restyle the scene as a watercolor painting") or give a style image as image.

Failover and the fast tier

Two hosts for Lucy 2.6 and 2.5

decart/lucy-2.6 and decart/lucy-2.6/fal (and the same for 2.5) are one model on two hosts at the same price. With fallback on (the default), if the host you named cannot open the session it opens on the other, and if the stream does not connect within connectTimeout (45 s) the other host is tried. model.activeModel says which one served, and your code does not change. Pass fallback: false to pin a host. A stream that drops after it started is not moved: handle onError.

To start on fal, set model: "decart/lucy-2.6/fal". fal needs no extra package.

Fast tier

const model = new RealtimeEditModel({ model: "decart/lucy-2.6", speed: "fast", hostSdk: { decart } });

fast costs 2× and is offered by decart/lucy-2.6, lucy-2.5, lucy-vton-3.6 and lucy-vton-3.5. It stays on Decart: there is no failover to fal.

Other models

The same RealtimeEditModel code runs every real-time editing model, including X2.1 and Vidu.

SDK reference

Constructor optionDefaultWhat it does
modelrequiredA model id from the table above
maxDurationSeconds120Session cap; the price of this much time is held
speedstandard"fast" on the models that have it
fallbacktrueUse the model's other host if needed (2.6 and 2.5)
connectTimeout45000 msHow long to wait for the stream
hostSdkdynamic import{ decart }, the @decartai/sdk module
Method or callbackWhat it does
connect(token)Give the browser token
start(stream, { prompt, image, enhance })Book and start. A prompt, an image, or both.
setPrompt(text, { image, enhance })Change the edit; the part you leave out is kept
end()Stop and settle. Call it on every exit path.
onRemoteStream(stream)The edited video
onState({ host, state })Connection states; the values are the host's own
onError(error)The stream failed after it started
activeModel, session.billedSeconds, session.costUsdWho served, and what it cost
hostThe host's own objects, for anything else: { name: "decart", client, realtime } or { name: "fal", socket, peer }

Errors and troubleshooting

ResponseMeaning
400 unknown model or optionThe id is not offered, or the model has no fast tier
402 insufficient_creditsYour balance cannot cover the hold. Add credit or lower maxDurationSeconds.
403 model_not_allowedThe token does not list this model id (list both hosts for failover)
429 concurrency_limit / host_capacityToo many open sessions, or the host is full. Retry after Retry-After.
502 host_unavailableNo host could take the session; nothing is held or billed. On Lucy 2.6 and 2.5 the other host has already been tried.
SymptomCheck
"did not connect within … ms"Network, VPN and firewall (video uses WebRTC). The first connection to fal/lucy-vton-2.1-webrtc can take about 30 seconds.
The reference image has no effectUse a clear image of at least 512×512. An expired upload link does nothing: upload again.
The result ignores part of your promptMake one clear change per prompt and name the target