Lucy Virtual Try-On
Dress subjects in long-form video using a prompt or a garment reference image
import { readFileSync, writeFileSync } from "fs";
import { createDecartClient, models } from "@decartai/sdk";
const client = createDecartClient({
apiKey: "--your-api-key--"
});
const videoBuffer = readFileSync("/path/to/person.mp4");
const videoBlob = new Blob([videoBuffer], { type: "video/mp4" });
// Clean garment image on white background works best
const imageBuffer = readFileSync("/path/to/garment.jpg");
const imageBlob = new Blob([imageBuffer], { type: "image/jpeg" });
const result = await client.queue.submitAndPoll({
model: models.video("lucy-vton-3"),
prompt: "Substitute the current top with a black bomber jacket with a blue logo on the chest and a zip front",
data: videoBlob,
reference_image: imageBlob,
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
promptOptionalDescribe the clothing or accessory to try on.
reference_imageOptionalUpload an image of the garment or accessory to try on.
dataRequiredVideo of the person to dress. Supports MP4, WebM, and QuickTime formats up to 200MB.
resolutionOptionalOutput video resolution. (default: 720p) (options: 720p)
promptstringNoDescribe the clothing or accessory to try on.reference_imageFileNoUpload an image of the garment or accessory to try on.dataFileYesVideo of the person to dress. Supports MP4, WebM, and QuickTime formats up to 200MB.resolutionstringNoOutput video resolution. (default: 720p) (options: 720p)Lucy Virtual Try-On
Dress subjects in long-form video with a prompt or a garment reference image
Apply garments to a full-length video in one shot. Upload a video of a person along with a reference image of the outfit — or describe it with a prompt — and Lucy Virtual Try-On dresses the subject realistically, preserving motion, body shape, and the surrounding scene from the original clip.
Pricing
Video models are charged per second of generated video. Final cost depends on video duration and selected resolution.