Lucy Virtual Try-On
Dress subjects live with a prompt or a garment reference image
2 credits per second
import { createDecartClient, models } from "@decartai/sdk";
const model = models.realtime("lucy-vton-3");
// 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 try the garment on the live stream
const realtimeClient = await client.realtime.connect(stream, {
model,
mirror: "auto",
onRemoteStream: (transformedStream) => {
const videoElement = document.querySelector("#video-output");
videoElement.srcObject = transformedStream;
}
});
// set() replaces the full state — prompt + garment image atomically
await realtimeClient.set({
prompt: "Wearing a black bomber jacket with a blue logo on the chest",
image: "https://example.com/garment.png",
});
// Switch the garment on the fly
await realtimeClient.set({
prompt: "Wearing a red leather jacket",
image: "https://example.com/red-jacket.png",
});
// Disconnect when done
realtimeClient.disconnect();
Available Endpoints
Request Parameters
promptOptionalType:string
Describe the clothing or accessory to try on.
imageOptionalType:File
Reference image of the garment or accessory. Passed via initialState.image or realtimeClient.set({ image }).
streamRequiredType:File
Video stream (WebRTC)
Parameter
Type
Required
Description
promptstringNoDescribe the clothing or accessory to try on.imageFileNoReference image of the garment or accessory. Passed via initialState.image or realtimeClient.set({ image }).streamFileYesVideo stream (WebRTC)Lucy Virtual Try-On
Dress subjects live with a prompt or a garment reference image
Swap outfits, accessories, and garments on a live video stream. Upload a reference image of the garment, describe it with a prompt, or do both — Lucy Virtual Try-On dresses the subject as they move, holding the fit, drape, and body shape stable frame to frame with zero perceptible latency.
Pricing
Model
Lucy Virtual Try-On 3
720p
2 Creditsper 1s
Model
Lucy Virtual Try-On 2
720p
2 Creditsper 1s
Model
Lucy 2.1 Virtual Try-On
720p
2 Creditsper 1s
Video models are charged per second of generated video. Final cost depends on video duration and selected resolution.