Skip to main content
Decart is a real-time AI video transformation service that applies artistic styles and effects to video streams. The Decart plugin enables you to transform your agent’s video feed with AI-powered restyling, creating immersive visual experiences like animated styles, cyberpunk aesthetics, or any custom prompt-based transformation. The Decart plugin for the Vision Agents SDK provides real-time video processing that transforms incoming video streams and publishes the styled output back to the call.

Features

  • 🎨 Real-time Video Restyling: Transform video with AI-powered style transfer
  • 🚀 WebRTC Streaming: Low-latency real-time video processing
  • 🔄 Dynamic Prompt Updates: Change styles on-the-fly during calls
  • 🪞 Mirror Mode: Optional mirroring for front-facing cameras

Installation

Install the Decart plugin with
uv add vision-agents-plugins-decart

Example

Check out our Decart example to see working code samples using the plugin, or read on for some key details.

Initialization

The Decart plugin exists in the form of the RestylingProcessor class:
from vision_agents.plugins import decart

processor = decart.RestylingProcessor(
    initial_prompt="Studio Ghibli animation style",
    model="mirage_v2"
)
To initialize without passing in the API key, make sure the DECART_API_KEY is available as an environment variable. You can do this either by defining it in a .env file or exporting it directly in your terminal.

Parameters

These are the parameters available in the Decart RestylingProcessor plugin for you to customize:
NameTypeDefaultDescription
api_keystr or NoneNoneYour Decart API key. If not provided, the plugin will look for the DECART_API_KEY environment variable.
modelstr"mirage_v2"Decart model name to use for video transformation.
initial_promptstr"Cyberpunk city"Initial style prompt describing the desired visual transformation.
enrichboolTrueWhether to enrich the prompt with additional details for better results.
mirrorboolTrueEnable mirror mode for front-facing cameras.
widthint1280Output video width in pixels.
heightint720Output video height in pixels.

How It Works

The Decart integration processes video in real-time:
  1. Video Input: Receives the user’s video stream from the call
  2. AI Processing: Sends frames to Decart’s Realtime API via WebSocket
  3. Style Transfer: Decart applies the prompt-based transformation to each frame
  4. Video Output: Publishes the transformed video back to the call
The processor maintains a persistent WebSocket connection to Decart’s API for low-latency processing.

Usage in Agent

Add the RestylingProcessor to your agent’s processors list:
from vision_agents.core import Agent, User
from vision_agents.plugins import getstream, openai, elevenlabs, deepgram, decart

async def create_agent():
    processor = decart.RestylingProcessor(
        initial_prompt="A cute animated movie with vibrant colours",
        model="mirage_v2"
    )
    
    agent = Agent(
        edge=getstream.Edge(),
        agent_user=User(name="Story Teller", id="agent"),
        instructions="You are a story teller with magical video effects.",
        llm=openai.LLM(model="gpt-4o-mini"),
        tts=elevenlabs.TTS(),
        stt=deepgram.STT(),
        processors=[processor]
    )
    
    return agent

Dynamic Prompt Updates

You can change the video style during a call by updating the prompt. This is useful for creating interactive experiences where the visual style responds to the conversation:
from vision_agents.core import Agent, User
from vision_agents.plugins import getstream, openai, decart

async def create_agent():
    processor = decart.RestylingProcessor(
        initial_prompt="Peaceful forest scene",
        model="mirage_v2"
    )
    
    llm = openai.LLM(model="gpt-4o-mini")
    
    agent = Agent(
        edge=getstream.Edge(),
        agent_user=User(name="Visual Guide", id="agent"),
        instructions="You guide users through different visual environments.",
        llm=llm,
        processors=[processor]
    )
    
    # Register a function to change the video style
    @llm.register_function(
        description="Changes the visual style of the video background"
    )
    async def change_style(prompt: str) -> str:
        await processor.update_prompt(prompt)
        return f"Video style changed to: {prompt}"
    
    return agent
Now your agent can dynamically change the video style based on the conversation:
User: "Can you make it look like a cyberpunk city?"
Agent: *calls change_style("Cyberpunk city with neon lights")*
       "I've transformed the scene into a cyberpunk city!"

Advanced Configuration

Mirror Mode

Control whether the video is mirrored (useful for front-facing cameras):
processor = decart.RestylingProcessor(
    initial_prompt="Watercolor painting style",
    mirror=True  # Enable mirroring
)

# Or update dynamically
await processor.set_mirror(False)

Custom Resolution

Adjust the output video resolution based on your needs:
processor = decart.RestylingProcessor(
    initial_prompt="Oil painting style",
    width=1920,   # Full HD width
    height=1080   # Full HD height
)
Higher resolutions require more bandwidth and processing power. The default 1280x720 provides a good balance between quality and performance.

Prompt Engineering Tips

For best results with Decart video transformations:
  • Be specific: “Studio Ghibli animation with soft colors” works better than just “animated”
  • Include style details: Mention artistic styles, color palettes, or visual effects
  • Use descriptive language: “Cyberpunk city with neon lights and rain” creates more vivid results
  • Experiment: Try different prompts to find what works best for your use case
Example prompts:
  • "Studio Ghibli animation style with vibrant colors"
  • "Cyberpunk city with neon lights and holographic displays"
  • "Watercolor painting with soft pastel colors"
  • "Retro 80s aesthetic with VHS effects"
  • "Fantasy medieval castle with magical atmosphere"

Troubleshooting

Connection Issues

If you experience connection problems:
  • Verify your Decart API key is valid
  • Ensure network access to Decart’s servers
  • Check firewall settings for WebSocket traffic

No Transformed Video

  • Check browser console for errors
  • Verify Decart API key has proper permissions
  • Ensure the processor is added to the agent’s processors list