Transform any video in realtime with AI-powered editing at 720p. Lucy 2.5 is a general editing model - capable across edit type, object, and scene.
Use Lucy 2.5 as your default realtime editing model. It supports text prompts, reference images, or both in the same integration.
Quick start
Installation
- JavaScript
- Python
- Android
Connect and start editing
- JavaScript
- Python
- Android
Model capabilities
Lucy 2.5 is designed as a general editing model - reliable across a wide range of tasks, object types, and input conditions.Edit types
Virtual try-on has a dedicated optimized model. See the Lucy - Virtual try-on model for details.
Use cases
Virtual try-on
Let customers see clothing and accessories on themselves in realtime. Supports a wide range of garment types, materials, and body conditions.
Ad variation
Generate personalized ad creatives at scale. Swap products, backgrounds, or characters across live or pre-recorded content without reshoots.
Social engagement
Give audiences interactive effects, filters, and transformations that drive participation and sharing.
Content monetization
Embed branded products and sponsored placements directly into live video.
Live shopping
Sell any product, in any video. Give sellers the ability to place any item into live content instantly.
Furniture replacement
Swap furniture and home decor in live video, letting customers visualize products in their own space before buying.
Updating the reference image
You can change the reference image at any time without reconnecting. Use theset() method to atomically replace the session state - include all fields you want to keep:
Reference image best practices
Use a clear, well-lit portrait
Consistent, even lighting works best regardless of edit type. For characters, use a front-facing photo. For garments and objects, avoid harsh shadows or reflections that obscure important details.
Match the framing
Match the reference framing to the source video. If the source shows a full-body standing person and you want to swap the character or change clothes, use a full-body reference shot rather than a head-and-shoulders crop.
Avoid occlusion
Make sure the key features of the reference are fully visible. Partially hidden characters, garments, or objects reduce what the model can extract and may affect output quality.
Resolution and format
At least 512×512 pixels recommended. Supported formats: JPEG, PNG, and WebP.
For object replacement
Use a clean product or object shot against a neutral background. The cleaner the separation between subject and background, the more precisely the model can apply it.
For virtual try-on
A front-facing, evenly lit garment shot on a plain background gives the model the clearest signal. Include the full item from collar to hem where possible.
Text-only editing
Lucy 2.5 works without a reference image too. Use text prompts to add, modify, or remove elements in your live video:Prompting guide
Strong prompts answer five questions: what should change, what should it become, where should it apply, how should it interact with the subject or environment, and what should stay the same. Think of the prompt as short creative direction. You do not need technical language. You do need clear visual details.For deeper guidance - layered edits, physical effects, restyle prompts, troubleshooting, and dos/don’ts - see the full Prompting guide for Lucy 2.5.
Avoid negative instructions such as “don’t add a hat” or “the person never changes clothes.” Describe what you want to see instead.
Character swap
When using a reference image, describe the character’s appearance in the prompt. The more detail you provide, the closer the output matches the reference. “Substitute the character in the video with <description of the character in the reference image>.” Examples:- Substitute the character with an older man, which has pale, wrinkled skin, light blue eyes, a powdered white wig with side curls, and wears a dark formal coat with a white ruffled neckpiece.
- Substitute the character with a young person wearing a short-sleeved pink top with white ribbon ties on the back, loose pink pants, and short brown hair tied in a side ponytail.
- Substitute the character with a furry creature, which has soft brown and orange fur, a light face with dark eye markings, a dark nose, and long claws.
Describe what you see in the reference image - skin tone, hair, clothing, distinctive features. Generic prompts like “Transform into this character” still work but produce less precise results.
Adding objects
Add new elements to the scene by specifying what to add and where to place it. “Add <description of object> to <where to add it>.” Examples:- Add a red conical hat, covered in sequins, with a white fluffy trim and a matching pompom to the person’s head.
- Add a coffee mug with a green logo to the person’s right hand.
Replacing objects
Swap an existing element in the scene with something different. “Change <object to change> with <description of the replacement>.” Examples:- Change the person’s sweater with a red knit sweater, which has a white-outlined, gold and white striped rectangular emblem on the chest.
- Change the phone in the person’s hand with a sleek black smartphone with a triple-lens camera on the back.
Removing objects
Remove an element from the scene. The model reconstructs the background behind it. “Remove <object to remove> from the scene.” Examples:- Remove the microphone stand from the scene.
- Remove the logo on the person’s shirt from the scene.
- Remove the bottle on the table from the scene.
Changing attributes
Modify a property of an existing object - color, texture, material - without replacing the object itself. “Change <object> to <description of new attribute>.” Examples:- Change the wall’s color to light blue, natural consistent paint finish.
- Change the shirt’s texture to knitted, woven fabric.
Background replacement
Replace the background of the scene with a new environment. Works with or without a reference image. “Change the background to <description of the new background>.” Examples:- Change the background to a sandy beach with clear blue water and a bright sunny sky.
- Change the background to a cozy living room with warm lighting, bookshelves, and a fireplace.
- Change the background to a neon-lit city street at night with reflections on wet pavement.
Style transformation
Apply a global visual style change to the entire scene - mood, aesthetic, or look and feel. “Change the style of the video to <style description>.” Examples:- Change the style of the video to a vintage 1970s film aesthetic with warm tones and slight grain.
- Change the style of the video to an anime illustration style with cel shading and bold outlines.
- Change the style of the video to a dark cyberpunk aesthetic with teal and magenta color grading.
Visual effects
Add dynamic effects to characters or environments. VFX use the same “Add” structure but describe effects rather than physical objects. “Add <effect description> to <location in scene>.” Examples:- Add shooting fireballs to the person’s hands.
- Add a large explosion with rising smoke to the background.
- Add a swirling vortex of electricity around the person.
Dos and don’ts
Connection lifecycle
Lucy 2.5 shares the same connection lifecycle as all realtime models. See the JavaScript SDK, Python SDK, or Android SDK for details on:- Connection states (
connecting,connected,generating,reconnecting,disconnected) - Auto-reconnect with exponential backoff
- Error handling with
DecartSDKError - Session tracking with
generationTickevents - Session viewing with subscribe tokens
Complete example
A full application with character switching, connection management, and error handling:Client-side authentication
For browser and mobile apps, use client tokens instead of your permanent API key.Technical specifications
Portrait mode (9:16)
On mobile devices (iOS/Android), portrait mode works automatically - the OS maps the front camera to a vertical stream regardless of the constraints you pass. For desktop browsers or external webcams, swapwidth and height when calling getUserMedia:
Generation stability
In long sessions, Lucy 2.5 can use its own output as an additional anchor - feeding recent generated frames back as the reference image. This self-anchoring mechanism keeps the output stable over time, preventing drifting. It is enabled by default, so most integrations need to do nothing. Self-anchoring is a connect-time setting. To turn it off, passself_anchor=false as a connection query parameter - the model then anchors only to the live input. Changing it requires a reconnect; it can’t be toggled mid-session with set().
Self-anchoring works best when the scene stays consistent. If the stream changes significantly - a different person enters the frame, the camera cuts, or the scene shifts entirely - the model may still anchor to the last edited frame, which no longer matches the new input. In these cases do not use self-anchoring.
Next steps
JavaScript SDK
Full JavaScript SDK reference for realtime features
Python SDK
Full Python SDK reference for realtime features
Android SDK
Full Android SDK reference for realtime features
All Models
Compare all Decart models side by side