StableAvatar

STABLEAVATAR

Talking-head video model (StableAvatar 1.3B) that makes a picture of a person speak or sing your recording, up to 8 seconds at 480p with your audio as the sound track, and can learn a face or a manner of speaking from your own clips.

Video Generationtalking-headavatarlip-syncvideo-generationwanmitFine-tunable
StableAvatar: Video Generation model on Kainguru

About StableAvatar

Capabilities

  • Picture and speech to video — a portrait and a recording become an H.264 MP4 of the person saying it, up to 209 frames, 8.4 seconds at 25 frames per second, with your audio as the sound track
  • Landscape or portrait — 832 x 480 or 480 x 832, the one closest to your picture
  • Prompt and guidance — describe the person and the scene, and set how closely the face follows the speech and the prompt
  • Repeatable — the same seed and inputs give the same video
  • Fine-tuning — teach it a face, a voice or a manner of speaking from 4 to 200 captioned clips with speech

Good to know

  • You pay for the frames the model generates, in whole windows (see below), not for the length of your recording; the video you get is as long as the recording.
  • Pictures: PNG, JPEG or WebP, at least 16 pixels a side. A face and shoulders work best; the picture is cropped to fill the video, so keep the face near the middle.
  • Speech: WAV, MP3, FLAC, OGG, M4A, AAC or WebM, at most 50 MB and 8.4 seconds, at least half a second. Clean speech or singing without background music works best.
  • The video is made in windows of 81 frames that overlap, so a request is rounded up to whole windows and the extra frames are cut off. You are billed for the whole windows, 81, 145 or 209 frames: a half-second recording costs one window and is billed as 81 frames, and a 5-second recording (125 frames) costs two windows and is billed as 145.
  • Prompts work best in English or Chinese; other languages are untested.
  • A video takes many minutes to make; fewer steps make it faster.
  • Without a negative prompt, Wan's default one is used: it steers away from oversaturated colour, still frames, blur, captions and malformed hands and faces.
  • Training clips: MP4, MOV, WebM or MKV with H.264, H.265, VP8, VP9, AV1 or MPEG-4 video and an audio track, at most 200 MB, 3840 pixels a side, 4K in all and 240 frames per second each.
  • Training uses the first 81 frames of each clip at 25 frames per second (about 3 seconds) and the speech under them, cropped to fill 832 x 480 or 480 x 832, whichever is closest to the clip's shape; a clip must give at least 5 frames and its audio must last as long as those frames. The first frame of every clip is the picture the model learns to animate.
  • In the training ZIP, manifest.jsonl has one {"file": ..., "caption": ...} line per clip, paths relative to it and captions of at most 2000 characters; the manifest is at most 4 MB and the ZIP holds at most 1000 entries.
  • Training stops after 9 hours and keeps what it has learned. A trigger word, if you set one, is put before every caption.

Attribution

StableAvatar by Shuyuan Tu and colleagues (MIT), built on Wan 2.1 Fun InP (Apache-2.0) and wav2vec 2.0 (Apache-2.0).

StableAvatar inputs and output

NameTypeRequiredDefaultDetails
audiofileYes—The recording the person speaks or sings: WAV, MP3, FLAC, OGG, M4A, AAC or WebM, at most 50 MB, sampled at 4 to 192 kHz with at most 8 channels. The video lasts as long as it does; clean speech without music works best. At most 8.4 seconds.
1–2048 characters · audio/wav, mpeg, flac, ogg, mp4, aac, webm
imagefileYes—A picture of the person or character who speaks: PNG, JPEG or WebP, at most 50 MB and 16.8 megapixels. A face and shoulders work best; it is cropped to fill the video.
1–2048 characters · image/png, jpeg, webp
audio_guidance_scalenumberNo5.0How strongly the mouth and face follow the speech: higher is more exact, too high looks strained.
1–10
prompttextNoA person is talking to the camera, mouth moving with the words, natural expression, steady shot.Who is speaking and how: appearance, expression, setting. Empty uses the model's default.
Max 2000 characters
num_inference_stepsintegerNo30Denoising steps; fewer are faster and rougher.
1–50
resolutiontextNo—Width x height in pixels, one of the sizes the model was trained at. Left empty, the size closest to the shape of the picture.
Allowed: 832x480, 480x832 · Max 9 characters
negative_prompttextNo—What the video should avoid; empty uses the model's default. Ignored at guidance 1.
Max 2000 characters
seedintegerNo—The same seed and inputs give the same video. Leave empty for a random seed.
0–2147483647
guidance_scalenumberNo3.0How closely the video follows the prompt; 1 ignores it.
1–10

Output. Returns MP4 video: The generated video: an H.264 MP4 as long as the audio, with the audio as its sound track.

Run StableAvatar with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=STABLEAVATAR" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "audio": "https://example.com/input.png",
    "image": "https://example.com/input.png",
    "audio_guidance_scale": 5.0,
    "guidance_scale": 3.0,
    "num_inference_steps": 30,
    "prompt": "A person is talking to the camera, mouth moving with the words, natural expression, steady shot."
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "STABLEAVATAR",
        {
          "audio": "https://example.com/input.png",
          "image": "https://example.com/input.png",
          "audio_guidance_scale": 5.0,
          "guidance_scale": 3.0,
          "num_inference_steps": 30,
          "prompt": "A person is talking to the camera, mouth moving with the words, natural expression, steady shot."
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

Fine-tune StableAvatar

You can fine-tune StableAvatar on your own data and run the tuned model through the same API. Dataset: One ZIP (at most 4 GB, no password) with 4 to 200 video clips of a person speaking, each with its audio, and a manifest.jsonl with one {"file": ..., "caption": ...} line per clip. More rules: Good to know, in the README.

The steps are in the docs.

StableAvatar pricing

Price per frame: 0.309415 credits ($0.00309415). The price is shown again before every run; all prices are on the pricing page.

Licence and source

InfiniteTalk: Video Generation model on Kainguru
Video Generation

InfiniteTalk

Talking-head video model (InfiniteTalk 14B, from an 8-bit build) that makes a picture of a person speak or sing your…

Fine-tunable
EchoMimic v3: Video Generation model on Kainguru
Video Generation

EchoMimic v3

Audio-driven avatar video. Give it a portrait and a speech clip and it returns a lip-synced talking video of up to 3.2…

Wan 2.2 S2V 14B: Video Generation model on Kainguru
Video Generation

Wan 2.2 S2V 14B

Talking-video model (Wan2.2-S2V 14B, from a 5-bit build) that makes a picture speak, sing or move to your recording…

Fine-tunable
Wan 2.2 T2V A14B: Video Generation model on Kainguru
Video Generation

Wan 2.2 T2V A14B

Turn a prompt into a video of up to 3 seconds at 480p, and teach it a style, subject or motion from your own clips.

Fine-tunable
LongCat Video: Video Generation model on Kainguru
Video Generation

LongCat Video

Video model (LongCat-Video, 13.6B) that makes a video of up to 3 seconds at 480p from a prompt, or from a prompt and a…

Fine-tunable
Wan 2.1 FLF2V 14B: Video Generation model on Kainguru
Video Generation

Wan 2.1 FLF2V 14B

First-and-last-frame video model (Wan 2.1 FLF2V 14B, served from a 5-bit build): joins two pictures with a clip of up…

Fine-tunable