> ## Documentation Index
> Fetch the complete documentation index at: https://docs.platform.decart.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Cases

> What you can build with Decart's realtime and batch AI models

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.

## Realtime use cases

Realtime models process live video and audio over WebRTC with sub-second latency. They run continuously as long as the connection is open.

<CardGroup cols={2}>
  <Card title="Character transformation" icon="masks-theater">
    Become any character on camera with Lucy 2.1. Upload a reference image and your movements map onto that identity in realtime.
  </Card>

  <Card title="Live streaming effects" icon="tower-broadcast">
    Apply artistic styles to live video with Lucy Restyle Live. Transform your stream into anime, cyberpunk, oil painting, and more.
  </Card>

  <Card title="Realtime video editing" icon="pen-to-square">
    Add, modify, or remove objects in live video with Lucy 2.1. Change outfits, add accessories, or swap backgrounds with text prompts.
  </Card>

  <Card title="Virtual try-on" icon="shirt">
    Let shoppers see how clothing looks on them in realtime. Send a garment image and prompt to Lucy VTON for instant outfit changes.
  </Card>
</CardGroup>

***

### Character transformation with Lucy 2.1

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.

```typescript theme={null}
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 transform
const characterPhoto = document.querySelector("input[type=file]").files[0]; // from file input
await realtimeClient.set({
  prompt: "Transform into this character",
  image: characterPhoto, // File, Blob, or URL
  enhance: true,
});

// Switch characters without reconnecting
const anotherPhoto = await fetch("/another-character.jpg").then((r) => r.blob());
await realtimeClient.set({ prompt: "Transform into this character", image: anotherPhoto });
```

<Tip>
  Lucy 2.1 also works without a reference image — pass only a `prompt` to `set()` for text-based editing.
</Tip>

### Live streaming effects with Lucy Restyle Live

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.

```typescript theme={null}
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 style
realtimeClient.setPrompt("Studio Ghibli animation style", { enhance: true });

// Switch styles on the fly
realtimeClient.setPrompt("Cyberpunk city with neon lighting");
realtimeClient.setPrompt("Watercolor painting with soft edges");
```

### Realtime video editing with Lucy 2.1

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.

```typescript theme={null}
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 scene
await 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" });
```

### Virtual try-on with Lucy VTON

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.

```typescript theme={null}
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 prompt
const 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 reconnecting
const 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,
});
```

<Tip>
  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](/examples/ecommerce-try-on) for a complete integration walkthrough.
</Tip>

***

## Batch use cases

Batch models process pre-recorded video and images asynchronously. Submit a job, poll for completion, then download the result.

<CardGroup cols={2}>
  <Card title="Video editing" icon="wand-magic-sparkles">
    Transform and edit existing videos — change styles, replace objects, or modify scenes.
  </Card>

  <Card title="Image editing" icon="image">
    Edit existing images with precise text-driven control.
  </Card>
</CardGroup>

***

### Video editing

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.

<CodeGroup>
  ```typescript JavaScript theme={null}
  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);
  }
  ```

  ```bash cURL theme={null}
  # Submit a video editing job
  curl -X POST https://api.decart.ai/v1/jobs/lucy-2.1 \
    -H "X-API-KEY: your-api-key-here" \
    -F "data=@input.mp4" \
    -F "prompt=Transform into Studio Ghibli animation style"

  # Poll for result
  curl https://api.decart.ai/v1/jobs/{job_id} \
    -H "X-API-KEY: your-api-key-here"

  # Download when complete
  curl https://api.decart.ai/v1/jobs/{job_id}/content \
    -H "X-API-KEY: your-api-key-here" \
    --output result.mp4
  ```
</CodeGroup>

### Image editing

Apply edits to existing images with text instructions.

**Best for:** product mockups, creative assets, visual prototyping, style transfers.

<CodeGroup>
  ```typescript Image editing theme={null}
  import { createDecartClient, models } from "@decartai/sdk";

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

  const result = await client.process({
    model: models.image("lucy-image-2"),
    data: "https://example.com/room.jpg", // File, Blob, URL, or ReadableStream
    prompt: "Change the wall color to deep burgundy, keep everything else the same",
    enhance_prompt: true,
  });
  ```
</CodeGroup>

***

## Choosing between realtime and batch

|                | **Realtime**                             | **Batch**                                      |
| -------------- | ---------------------------------------- | ---------------------------------------------- |
| **Latency**    | Sub-second (WebRTC)                      | Seconds to minutes (async jobs)                |
| **Input**      | Live camera or video stream              | Pre-recorded files                             |
| **Connection** | Persistent — runs as long as connected   | One-shot — submit, poll, download              |
| **Pricing**    | Per second of connection time            | Per second of output video                     |
| **Best for**   | Interactive apps, live streaming, mobile | Post-production, content pipelines, automation |

<Info>
  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.
</Info>

## Next steps

<CardGroup cols={2}>
  <Card title="Lucy 2.1 guide" icon="sparkles" href="/models/realtime/lucy-2.1">
    Deep dive into character transformation with reference images.
  </Card>

  <Card title="E-commerce try-on" icon="shirt" href="/examples/ecommerce-try-on">
    Add a "Try it on" button to product pages with realtime virtual try-on.
  </Card>

  <Card title="Realtime mobile app" icon="mobile" href="/examples/real-time-mobile-app">
    Build a complete Expo app with model switching and style presets.
  </Card>

  <Card title="All models" icon="layer-group" href="/getting-started/models">
    Compare every Decart model — realtime and batch — side by side.
  </Card>
</CardGroup>
