Use this file to discover all available pages before exploring further.
Decart’s models power a range of creative and production applications — from realtime character transformation on mobile to batch video processing for content pipelines. This page highlights the most common use cases with recommended models and starter code for each.
Turn yourself into any character — live on camera. Lucy 2.1 takes a reference image and maps your facial expressions, head movements, and gestures onto that character.Best for: virtual cosplay, social filters, virtual try-on, character-driven content creation.
import { createDecartClient, models } from "@decartai/sdk";const client = createDecartClient({ apiKey: "your-api-key-here" });const model = models.realtime("lucy-2.1");const stream = await navigator.mediaDevices.getUserMedia({ video: { frameRate: model.fps, width: model.width, height: model.height },});const realtimeClient = await client.realtime.connect(stream, { model, onRemoteStream: (transformed) => { document.getElementById("output").srcObject = transformed; },});// Upload a character reference and transformconst characterPhoto = document.querySelector("input[type=file]").files[0]; // from file inputawait realtimeClient.set({ prompt: "Transform into this character", image: characterPhoto, // File, Blob, or URL enhance: true,});// Switch characters without reconnectingconst anotherPhoto = await fetch("/another-character.jpg").then((r) => r.blob());await realtimeClient.set({ prompt: "Transform into this character", image: anotherPhoto });
Lucy 2.1 also works without a reference image — pass only a prompt to set() for text-based editing.
Transform the entire visual style of a live video feed. Lucy Restyle Live applies artistic styles in realtime — ideal for Twitch, YouTube Live, or TikTok.Best for: social media filters, creative livestreams, virtual events, themed video calls.
import { createDecartClient, models } from "@decartai/sdk";const client = createDecartClient({ apiKey: "your-api-key-here" });const model = models.realtime("lucy-restyle-2");const stream = await navigator.mediaDevices.getUserMedia({ video: { frameRate: model.fps, width: model.width, height: model.height },});const realtimeClient = await client.realtime.connect(stream, { model, onRemoteStream: (styled) => { document.getElementById("output").srcObject = styled; },});// Apply a stylerealtimeClient.setPrompt("Studio Ghibli animation style", { enhance: true });// Switch styles on the flyrealtimeClient.setPrompt("Cyberpunk city with neon lighting");realtimeClient.setPrompt("Watercolor painting with soft edges");
Make targeted edits to live video using text prompts. Add objects, change clothing, swap backgrounds — all without interrupting the stream.Best for: interactive experiences, photo booths, AR-style effects, live content creation.
import { createDecartClient, models } from "@decartai/sdk";const client = createDecartClient({ apiKey: "your-api-key-here" });const model = models.realtime("lucy-2.1");const stream = await navigator.mediaDevices.getUserMedia({ video: { frameRate: model.fps, width: model.width, height: model.height },});const realtimeClient = await client.realtime.connect(stream, { model, onRemoteStream: (edited) => { document.getElementById("output").srcObject = edited; },});// Add objects, change outfits, modify the sceneawait realtimeClient.set({ prompt: "Add a small dog running around", enhance: true });await realtimeClient.set({ prompt: "Change the outfit to a sharp black tuxedo with satin lapels" });await realtimeClient.set({ prompt: "Replace the background with a beach at sunset" });
Let shoppers see how clothing looks on them in realtime. Lucy VTON takes a garment reference image and a descriptive prompt, then dresses the person on camera — perfect for e-commerce “Try it on” buttons, digital mirrors, and styling apps.Best for: e-commerce product pages, in-store kiosks, digital mirrors, styling and outfit planning.
import { createDecartClient, models } from "@decartai/sdk";const client = createDecartClient({ apiKey: "your-api-key-here" });const model = models.realtime("lucy-vton-latest");const stream = await navigator.mediaDevices.getUserMedia({ video: { facingMode: "user" },});const realtimeClient = await client.realtime.connect(stream, { model, onRemoteStream: (dressed) => { document.getElementById("output").srcObject = dressed; },});// Send a garment image with a descriptive promptconst garmentBlob = await fetch("/products/bomber.png").then((r) => r.blob());await realtimeClient.set({ prompt: "Substitute the current top with a black bomber jacket with a blue logo on the chest and a zip front", image: garmentBlob, enhance: false,});// Switch garments without reconnectingconst beanieBlob = await fetch("/products/beanie.png").then((r) => r.blob());await realtimeClient.set({ prompt: "Add a navy blue knit beanie with a white logo on the fold to the person's head", image: beanieBlob, enhance: false,});
Use the substitute pattern when replacing an existing garment ("Substitute the current top with...") and the add pattern for new items ("Add a hat to the person's head"). See the full e-commerce try-on example for a complete integration walkthrough.
Transform existing videos with text instructions. Change styles, replace objects, or modify entire scenes while preserving the original motion.Best for: post-production, content repurposing, brand transformations, visual effects.
import { createDecartClient, models } from "@decartai/sdk";import { readFileSync, writeFileSync } from "fs";const client = createDecartClient({ apiKey: "your-api-key-here" });const videoBlob = new Blob([readFileSync("input.mp4")], { type: "video/mp4" });const result = await client.queue.submitAndPoll({ model: models.video("lucy-2.1"), data: videoBlob, prompt: "Replace the person's outfit with a medieval knight's armor", onStatusChange: (job) => console.log(`Status: ${job.status}`),});if (result.status === "completed") { const buffer = Buffer.from(await result.data.arrayBuffer()); writeFileSync("edited.mp4", buffer);}
Realtime and batch models use the same @decartai/sdk package. The difference is how you connect — client.realtime.connect() for realtime, client.queue.submitAndPoll() for video, client.process() for images.