Decart Logo
  • Real-time
  • Lucy Edit Live
    Lucy Edit LiveRealtime Video Editing
  • Lucy Restyle Live
    Lucy Restyle LiveRealtime Video Restyling
  • LipSync Live
    LipSync LiveRealtime Lips movement
  • Avatar Live
    Avatar LiveRealtime Avatar animation
  • Video models
  • Lucy
    LucyText/Image to Video
  • Lucy Edit
    Lucy EditVideo to Video
  • Lucy Edit
    Lucy Edit 2Long Video Editing
  • Lucy Motion
    Lucy MotionImage to Video
  • Lucy Restyle Live
    Lucy RestyleLong Video Restyling
  • Image models
  • Lucy Image
    Lucy ImageText to Image
  • Lucy Image Edit
    Lucy Image EditImage to Image
  • Cookbook icon
    Cookbook
  • Documentation icon
    Documentation
  1. Models
  2. Avatar Live
Avatar Live icon

Avatar Live

Realtime avatar animation with audio-driven facial expressions

Realtime avatar animation with audio-driven facial expressions

Documentation
1 Credit Per Second
1 Credit Per Second

Select a default portrait or upload your own image (max 5MB)

Upload audio file

or

Click to record audio

Select an image to begin

import { createDecartClient, models } from "@decartai/sdk";

const model = models.realtime("live_avatar");

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

// Option 1: Use playAudio() to inject audio files
const realtimeClient = await client.realtime.connect(null, {
  model,
  initialState: {
    image: "/path/to/avatar.jpg", // URL, File, or Blob
  },
  onRemoteStream: (videoStream) => {
    const videoElement = document.querySelector("#avatar-output");
    videoElement.srcObject = videoStream;
  }
});

// Play audio through the avatar
const audioBlob = await fetch("/speech.mp3").then(r => r.blob());
await realtimeClient.playAudio(audioBlob);

// Disconnect when done
realtimeClient.disconnect();

// Option 2: Use mic input directly
const micStream = await navigator.mediaDevices.getUserMedia({
  audio: true,
  video: false
});

const realtimeClient2 = await client.realtime.connect(micStream, {
  model,
  initialState: {
    image: avatarFile, // File or Blob
  },
  onRemoteStream: (videoStream) => {
    videoElement.srcObject = videoStream;
  }
});
// Avatar now speaks whatever the user says into the mic

Available Endpoints

Request Parameters

imageRequired
Type:File

Portrait image to animate (WebRTC)

audioRequired
Type:File

Audio stream for animation (WebRTC)

Parameter
Type
Required
Description
imageFileYesPortrait image to animate (WebRTC)
audioFileYesAudio stream for animation (WebRTC)

Avatar Live

Generate real time, natural avatar video from image and audio

Animate any image using audio in real-time. Stream audio, and get your avatar image speaking and moving naturally without lag.

Pricing

Model
pro
720p
1 Creditsper 1s

Video models are charged per second of generated video. Final cost depends on video duration and selected resolution.

Examples