Skip to navigation

Text-to-Speech Lip Sync Guide

Combine text-to-speech with lip sync to create talking head videos from just text and a source video. Type a script, pick a voice, and sync. labs generates a video where the speaker’s lips match the spoken words.

Choose the right dubbing workflow

Starting pointWorkflow
A source video with speech that needs translationUse dubParams to translate, synthesize speech, and lip sync in one job. Do not add a separate audio or text input.
A translated script and a specific ElevenLabs voice IDUse a video input plus the text input below. For a voice in your own ElevenLabs account, connect that account in Integrations settings; connection eligibility depends on your plan and the integration’s requirements shown there.
A finished recording from a voice actor or TTS providerSubmit the source video and finished audio using the external TTS workflow.

dubParams uses the source video’s audio for automatic dubbing. Use the text-input workflow when you need to select a specific ElevenLabs voice.

Using the Built-in ElevenLabs Integration

sync. labs’ ElevenLabs integration handles TTS and lip sync in a single API call.

Free built-in text-to-speech accepts up to 320 characters and 20 seconds of speech per request. The resulting video must also fit the free plan’s 15-second limit. See Free-tier limits.

import { SyncClient } from "@sync.so/sdk";
const sync = new SyncClient();
async function main() {
const response = await sync.generations.create({
input: [
{
type: "video",
url: "https://assets.sync.so/docs/example-video.mp4",
},
{
type: "text",
provider: {
name: "elevenlabs",
voiceId: "EXAVITQu4vr4xnSDxMaL",
script: "Hey there. I wanted to walk you through our latest features. We shipped three major updates this week.",
stability: 0.5,
similarityBoost: 0.75,
},
},
],
model: "lipsync-2",
options: { sync_mode: "cut_off" },
});
const jobId = response.id;
console.log(`Job submitted: ${jobId}`);
// Poll for completion
let generation = await sync.generations.get(jobId);
while (!["COMPLETED", "NO_OP", "FAILED", "REJECTED"].includes(generation.status)) {
await new Promise((r) => setTimeout(r, 10000));
generation = await sync.generations.get(jobId);
}
if (generation.status === "COMPLETED") {
console.log(`Video ready: ${generation.outputUrl}`);
} else {
console.log(`Generation failed: ${jobId}`);
}
}
main();

ElevenLabs Provider Parameters

ParameterTypeDefaultDescription
namestring—Must be "elevenlabs"
voiceIdstring—ElevenLabs voice ID. Must be a non-empty string.
scriptstring—Text to speak (max 5,000 characters)
stabilityfloat0.5Voice stability (0.0-1.0). Lower = more expressive.
similarityBoostfloat0.75Voice similarity to original (0.0-1.0). Higher = closer match.

Enable the ElevenLabs integration from your Integrations settings. You can use sync. labs’ built-in integration or provide your own ElevenLabs API key (Creator plan or higher).

Some ElevenLabs voices require verification before they can be used for TTS. If a generation fails with a message that the voice may violate ElevenLabs Terms of Service or requires verification, try a different verified voice or complete verification with ElevenLabs before retrying.

Using External TTS Providers

If you use a TTS provider other than ElevenLabs — Google Cloud TTS, Amazon Polly, Azure Speech, or any other service — generate the audio first, host it at a public URL, then pass it to sync. labs.

import { SyncClient } from "@sync.so/sdk";
const sync = new SyncClient();
// Audio generated by your TTS provider, hosted at a public URL
const ttsAudioUrl = "https://your-cdn.com/generated-speech.mp3";
const response = await sync.generations.create({
input: [
{ type: "video", url: "https://assets.sync.so/docs/example-video.mp4" },
{ type: "audio", url: ttsAudioUrl },
],
model: "lipsync-2",
options: { sync_mode: "cut_off" },
});
const jobId = response.id;
console.log(`Job submitted: ${jobId}`);
let generation = await sync.generations.get(jobId);
while (!["COMPLETED", "NO_OP", "FAILED", "REJECTED"].includes(generation.status)) {
await new Promise((r) => setTimeout(r, 10000));
generation = await sync.generations.get(jobId);
}
if (generation.status === "COMPLETED") {
console.log(`Video ready: ${generation.outputUrl}`);
}

This approach works with any TTS provider. The only requirement is that the audio file is accessible via a public URL.

Voice Cloning Workflow

Clone a speaker’s voice with ElevenLabs, then use that cloned voice ID with sync. labs’ integration. The result: a video where the speaker looks AND sounds like themselves — speaking entirely new words.

1

Clone the voice

Upload a clean audio sample of the speaker to ElevenLabs to create a cloned voice. You get back a voice ID.

# Use ElevenLabs API or dashboard to clone a voice
# https://elevenlabs.io/docs/voices/voice-cloning
cloned_voice_id = "your-cloned-voice-id"
2

Generate lipsync with the cloned voice

Use the cloned voice ID in your sync. labs API call.

from sync import Sync
from sync.common import Video, TTS, GenerationOptions
sync = Sync()
response = sync.generations.create(
input=[
Video(url="https://your-cdn.com/speaker-video.mp4"),
TTS(
provider={
"name": "elevenlabs",
"voiceId": cloned_voice_id,
"script": "This is the new script I want the speaker to say.",
"stability": 0.5,
"similarityBoost": 0.85, # Higher similarity for cloned voices
}
),
],
model="lipsync-2-pro", # Pro model for highest quality
options=GenerationOptions(sync_mode="cut_off"),
)
3

Download the result

Poll for completion and retrieve the output video. The speaker now says the new script with their own voice and matching lip movements.

Best Practices

Keep scripts under 5,000 characters

The ElevenLabs integration has a 5,000-character limit per generation. For longer scripts, split them into segments using the Segments API, with each segment referencing a separate TTS input.

Tune voice settings

Stability controls how consistent the voice sounds. Lower values (0.2-0.4) produce more expressive, varied speech. Higher values (0.6-0.8) produce more consistent, predictable speech. Similarity boost controls how closely the output matches the original voice. For cloned voices, use higher values (0.8-0.9).

Use sync-3 for the highest quality

For talking head videos where the face is prominent or the scene is challenging, sync-3 is the highest-quality option. It handles obstructions, extreme angles, low light, and 4K output better than earlier lipsync models. Use lipsync-2-pro when you want premium facial detail at a lower price point than sync-3.

Use react-1 for expressive results

For short clips (under 15 seconds) where you want the speaker to show emotion, use react-1 with an emotion prompt. The model generates facial expressions and head movements that match the audio tone.

Multi-Segment TTS

For longer scripts or multi-speaker scenarios, use the Segments API with multiple TTS inputs:

from sync import Sync
from sync.common import Video, TTS
sync = Sync()
response = sync.generations.create(
input=[
Video(url="https://your-cdn.com/video.mp4"),
TTS(
provider={
"name": "elevenlabs",
"voiceId": "voice-id-1",
"script": "Welcome to the first section of our presentation.",
},
ref_id="intro",
),
TTS(
provider={
"name": "elevenlabs",
"voiceId": "voice-id-2",
"script": "Now let me hand it over to my colleague for the demo.",
},
ref_id="handoff",
),
],
segments=[
{"startTime": 0, "endTime": 8, "audioInput": {"refId": "intro"}},
{"startTime": 8, "endTime": 15, "audioInput": {"refId": "handoff"}},
],
model="lipsync-2",
)

Troubleshooting TTS

Most failures come from an invalid voice ID, an oversized script or a missing integration setting. Check, in order:

  1. The voiceId is a valid, non-empty ElevenLabs voice ID. An empty string ("") returns a 422 error. A voice ID stops working if the voice is deleted from your ElevenLabs account, or if it’s a shared voice that is no longer available.
  2. The script fits the 5,000-character maximum. Free built-in text-to-speech is limited to 320 characters and 20 seconds of speech; see free-tier limits.
  3. The ElevenLabs integration is enabled in your Integrations settings.

For the exact error code and message, check the response from GET /v2/generate/{id}.

In the ElevenLabs dashboard, open Voices and select the voice. Its ID is in the URL bar or the voice settings panel, and looks like EXAVITQu4vr4xnSDxMaL. You can also get voice IDs from the ElevenLabs List Voices endpoint. A cloned voice’s ID is returned when you create the clone.

Copy the ID exactly, since it’s case-sensitive, and pass it as voiceId in your sync. labs API request. On a free account with the built-in ElevenLabs integration, you can use any default ElevenLabs voice without your own ElevenLabs account.

Yes. ElevenLabs multilingual voice models speak over 29 languages, including Spanish, French, German, Portuguese, Japanese, Chinese, Arabic and Hindi. Choose a voice that supports your target language (the ElevenLabs voice library labels multilingual voices), then write your script in that language.

sync. labs’ lip sync models are language-agnostic, so they match lip movements to the generated audio in any language. For the best results, pick a voice that is native to your target language rather than one voice for every language.

Next Steps

Support Knowledge Base