Overview
With any LemonSlice avatar model, you can change the character’s reference image during an active call. Simply post anupdate-image event to our REST endpoint with either a public URL or the raw image bytes (base64-encoded).
Call it from an LLM tool, your backend, a webhook, or any client. The LemonSlice video stream reflects the new image in under a second.
Latency in this demo comes from initiating the tool call (upstream of LemonSlice). Image changes take ~600 ms.
Applications
Real-time image updates go beyond passive interactive avatars and make characters feel truly immersive: the avatar’s look can follow the narrative arc of the conversation, shifting appearance, scene, or even identity based on context as the call unfolds.End-to-end example
Our example repo provides a complete Next.js + LiveKit Agents demo with three entry points for image changes:- Tool call — LLM picks a new image based on conversational context
- Upload — user supplies a new image (URL or local upload)
- Prompt-based edit — an image-edit model generates a new image from a text prompt, then applies it
How to trigger
Send aPOST to the LemonSlice control endpoint with event: "update-image" and exactly one of:
image_url— a publicly accessible URL to the new imageimage_base64— the raw image bytes, base64-encoded (adata:image/...;base64,data URL also works). The decoded image must be under 900 KB.
{ "success": true }. That means the control event was accepted; the video stream switches to the new image in under a second.
Listen for completion
When the new image is loaded and LemonSlice has started pushing frames from it, we emit a message over the relevant transport channel. It can be helpful to listen to these events to trigger a follow-up response once the new image is live and surface failures:
Listen on LiveKit’s
lemonslice data topic or Pipecat’s Daily app-message channel:
Recommended UI
The avatar stays fully functional during an image update — it can still receive audio and continue the call. You do not need to tear down video or block the room. The swap itself acts as an interruption (any audio currently playing is cut off), so trigger it during silence when possible. Since it completes in under a second, the update generally doesn’t need a transitional UI state: just let the video change. An exception is prompt-based edits, where an image-edit model like Nano Banana generates the new image on the fly. Image generation models still take several seconds, and that latency happens before LemonSlice is involved. For that flow, we recommend showing a transitional state while the image is being generated:- When the user submits a prompt, enter a transitional UI state
- Keep the existing video visible; overlay a subtle indicator, such as the iridescent shader in our example
- When generation finishes, send the
update-imageevent - On
image_change_complete, clear the indicator and optionally generate a response - On
image_change_erroror timeout, clear the indicator and surface an error if desired
Additional Tips
- Use images that follow our Avatar Image Tips.
- Avoid unnecessarily large image files — bigger payloads add latency to the change.
- Keep a small library of pre-hosted HTTPS images for predictable tool-driven updates; use an image-edit API (e.g. Fal) when you want to support open-ended or user-defined changes.
- For full character changes (including voice and personality), coordinate LemonSlice’s
update-imagewith your own TTS voice and LLM instructions outside LemonSlice.

