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

# Decart

[Decart](https://decart.ai/) provides real-time AI video transformation with style transfer and virtual try-on. Transform video streams into animated styles, apply reference-image costumes, or any custom prompt-based visual effect using models like Lucy.

<Info>
  Vision Agents uses [Stream Video](https://getstream.io/video/) for real-time WebRTC transport by default. [External WebRTC transports](/integrations/introduction-to-integrations#edge-transport) are supported as well. Most AI providers offer free tiers to get started.
</Info>

## Installation

```sh theme={null}
uv add "vision-agents[decart]"
```

## Quick start

```python theme={null}
from vision_agents.core import Agent, User
from vision_agents.plugins import decart, gemini, deepgram, elevenlabs, getstream

processor = decart.RestylingProcessor(
    initial_prompt="Studio Ghibli animation style",
    model="lucy_2_rt",
)

agent = Agent(
    edge=getstream.Edge(),
    agent_user=User(name="Styled AI"),
    instructions="Be helpful",
    llm=gemini.Realtime(),
    stt=deepgram.STT(),
    tts=elevenlabs.TTS(),
    processors=[processor],
)
```

<Warning>
  Set `DECART_API_KEY` in your environment or pass `api_key` directly.
</Warning>

## Parameters

| Name | Type | Default | Description |
| - | - | - | - |
| `model` | `str` | `"lucy_2_rt"` | Decart model |
| `initial_prompt` | `str` | `"Cyberpunk city"` | Style prompt for visual transformation |
| `initial_image` | `bytes \| str \| Path` | `None` | Optional reference image for first connect (bytes, file path, http(s) URL, data URI, or raw base64) |
| `enhance` | `bool` | `True` | Whether to enhance the prompt |
| `mirror` | `bool` | `True` | Mirror mode for front-facing cameras |
| `width` | `int` | `1280` | Output video width |
| `height` | `int` | `720` | Output video height |
| `api_key` | `str` | `None` | API key (defaults to `DECART_API_KEY` env var) |

## Dynamic style changes

Update the video style during a call via function calling:

```python theme={null}
@llm.register_function(description="Changes the video style")
async def change_style(prompt: str) -> str:
    await processor.update_prompt(prompt)
    return f"Style changed to: {prompt}"
```

## Reference images

For models like Lucy that accept a reference image, pass it at construction time and/or swap it atomically with a prompt using `update_state`:

```python theme={null}
processor = decart.RestylingProcessor(
    model="lucy_2_rt",
    initial_prompt="A person wearing a superhero costume",
    initial_image="./costumes/superhero.png",
)

# Atomically change prompt + reference image
await processor.update_state(
    prompt="A person wearing a wizard robe",
    image="./costumes/wizard.png",
)

# Image-only update
await processor.update_state(image=b"<raw image bytes>")
```

`initial_image` and `update_state(image=...)` accept `bytes`, a local file path, an `http(s)` URL, a `data:` URI, or a raw base64 string.

## Next steps

<CardGroup cols={2}>
  <Card title="Build a Voice Agent" icon="microphone" href="/introduction/voice-agents">
    Get started with voice
  </Card>

  <Card title="Build a Video Agent" icon="video" href="/introduction/video-agents">
    Add video processing
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.