TokenLab

Media Guides

Photo to Lip-Sync Video

Turn one portrait photo and a line of speech into a talking video

Two models on TokenLab do this job: omnihuman-1-5 from ByteDance and p-video-avatar from Pruna AI. Both take one image of a person plus one audio track and return a video where that face speaks the audio. Everything else — the endpoint, the async task record, polling — is the same as any other video request, so read Video Generation first and come back here for the parts that are specific to talking-head clips.

The workflow below is what a talking portrait needs in practice: speech first, then a clean portrait, then clips of five to ten seconds, then assembly.

Do it in the console

If you would rather not write the request yourself, the media workbench does the same job with a form. Open one of these two links; each one preselects the talking-avatar workflow and its model:

Attach one portrait photo with the paperclip next to the prompt box — JPG, PNG or WebP, at most 10 MB — and enter the audio as a public HTTPS URL, the same thing the API takes as audio_url. Then submit: the request runs on that page, and the finished video appears under Media on the same page. If you are signed out, the link takes you to sign-in first and returns you to the workbench with its parameters intact.

The media page opens on text-to-image by default, and that preset has no photo upload field — that is why the two links above spell out the workflow and the model instead of pointing at the bare page.

Step 1: Generate the speech line by line

Start with audio, because both models are driven by the audio track: the voice sets the timing and the mouth movements follow it. Call POST /v1/audio/speech once per sentence and keep one file per sentence. Split by sentence rather than producing one long take, so that you can regenerate a single mispronounced line later without redoing the whole video, and so that each generated clip stays short.

curl -X POST "https://api.tokenlab.sh/v1/audio/speech" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-tts",
    "voice": "eve",
    "input": "Welcome to the team. Your first week starts Monday at nine."
  }' \
  --output line-01.mp3

Read the current speech models with GET /v1/models?recommended_for=tts before you fix a model and voice. Put the resulting audio behind a public HTTPS URL that stays reachable until the video task is created.

Step 2: Crop the photo down to one face

The portrait decides identity. Use a single person, facing the camera, at the highest resolution you have, and crop out other people and distracting background. A cropped or low-resolution face limits identity fidelity, which is the limitation the OmniHuman-1.5 model details name for the reference image. P-Video-Avatar steadies the same way: it works best with a fixed camera, and sweeping camera moves are a poor fit for a talking head. The photo becomes the first frame, so its framing and aspect ratio carry through the whole clip.

Send image_url as a public HTTPS URL, or as a supported data URL if you cannot host the file.

Step 3: Generate one clip per line

Call POST /v1/videos/generations with operation: "image-to-video". For these two models image_url and audio_url are both required — a request with only one of them is rejected, because the model needs a face and a voice together.

{
  "model": "omnihuman-1-5",
  "operation": "image-to-video",
  "image_url": "https://example.com/portrait.jpg",
  "audio_url": "https://example.com/line-01.mp3"
}

Swap in the other model ID for the second track, or when the price per second matters more than identity fidelity:

ModelPrice
omnihuman-1-5$0.13247 per second
p-video-avatar$0.025–0.045 per second, by resolution (720p or 1080p)

omnihuman-1-5 is the stronger choice when the face must stay recognisable through a longer performance. p-video-avatar is the cheaper way to produce many short versions, and it bills by resolution, so draft at 720p and only re-render the versions you keep at 1080p.

Both models are asynchronous. The response carries a task ID and usually a poll_url; poll GET /v1/tasks/{id} until the video is finished.

curl "https://api.tokenlab.sh/v1/tasks/{id}" \
  -H "Authorization: Bearer sk-your-api-key"

Step 4: Assemble five- to ten-second clips

Generate five to ten seconds per clip and join them in an editor. Long single calls drift: P-Video-Avatar's own guidance is to keep clips short for consistent results, and short clips also let you replace one bad line without touching the rest. Keep the same portrait and the same voice settings across clips so the joins are not visible.

Caption in post. These models output a talking face, not a subtitle track, so burn in or attach subtitles in your editor after the clips are joined.

One call drives one face

A single image-to-video call drives one face. If the script has two people talking to each other, split it by speaker, generate a scene for each speaker with that speaker's portrait and audio, and join the scenes in the edit. Do not expect one call with two portraits to return a conversation — each request carries one image (image_url accepts one value) and one audio track.

Check the trial credit before scaling up

The $0.25 trial credit does not cover one 25-second video: at $0.13247 per second that is about $3.31 on omnihuman-1-5, and $0.625 to $1.125 on p-video-avatar depending on the resolution. Run one five-second test shot first — roughly $0.66 on omnihuman-1-5, or $0.125–$0.225 on p-video-avatar — and check identity, lip sync and audio sync before you generate the remaining lines. A test shot also tells you whether the portrait crop is good enough before you pay for the full set.

Next steps

  • Video Generation for the endpoint, operation names and error fields shared with every video model.
  • GET /v1/models/{id} for the supported fields of the model you picked; fields outside that list are rejected.
  • Async jobs and polling for retry and status handling around task records.

On this page