audiostringobbligatorio
Input audio URL.
heygen/lipsync/precisionHeyGen v3 Lipsync (precision) replaces the speech in a video and re-syncs the speaker's lips to the new audio.
Prova il modello
Cosa vuoi fare dopo?
Seleziona un esempio per caricare i suoi input e il risultato nel playground.
{
"audio": "https://static.sandbase.ai/examples/3c0d2094-8315-4f9f-bfbd-1a209d8ab9e0/input/733399b2-2dc9-4da1-93ed-5b156997b3c6.mp3",
"video": "https://static.sandbase.ai/examples/3c0d2094-8315-4f9f-bfbd-1a209d8ab9e0/input/c517493c-b3d5-4f92-be2f-684336862d50.mp4"
}HeyGen Lipsync (precision) replaces the speech in a video and re-syncs the speaker's lips to new audio. Precision gives the best sync.
| Field | Type | Default | Notes |
|---|---|---|---|
video | video URL, required | — | Video with the speaker. |
audio | audio URL, required | — | New speech. |
disable_music_track | boolean | false | Drop background music. |
enable_caption | boolean | false | Burn in captions. |
enable_dynamic_duration | boolean | true | Adjust video length to the new audio. |
enable_speech_enhancement | boolean | false | Clean up the new speech. |
end_time | number | — | Optional end of the section. |
start_time | number | — | Optional start of the section to sync (seconds). |
$0.10 per output second. The quote before submission assumes 5 seconds.
| Output | Price |
|---|---|
| 5s | $0.50 |
| 30s | $3.00 |
| 60s | $6.00 |
Failed runs are not charged.
Related: heygen/lipsync/speed, sync/lipsync/3.0/video-to-video.
Inizia a costruire
Invia questo modello tramite la SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "heygen/lipsync/precision",
"audio": "https://v3.fal.media/files/rabbit/Ql3ade3wEKlZXRQLRbhxm_tts.mp3",
"video": "https://media.sandbase.ai/files/922d1013-9018-4956-a39d-d0859149ba76/0.mp4",
"enable_caption": false,
"disable_music_track": false,
"enable_dynamic_duration": true,
"enable_speech_enhancement": false
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Crea una SandBase API key e impostala nell'ambiente del server. Tutte le richieste usano l'autenticazione Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserva la key sul server. Non esporla nel codice del browser né committarla in un repository.
Esegui POST su /v1/run con questo ID modello e i relativi input. L'esempio di richiesta sopra include invio e polling.
Usa il run ID restituito per fare polling finché lo stato non è completed, failed o timeout. Leggi l'output solo dopo completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Passa un URL di file accessibile pubblicamente nel campo image, video o audio del modello. I formati supportati e i limiti sono mostrati accanto a ciascun input del Playground.
Usa il controllo upload o replace sui campi immagine supportati nel Playground. I campi URL video accettano un video di driving ospitato; non implicano il supporto al caricamento video.
audiostringobbligatorioInput audio URL.
videostringobbligatorioInput video URL.
end_timenumberEnd time (seconds) for partial lipsync.
Minimo: 0
start_timenumberStart time (seconds) for partial lipsync.
Minimo: 0
enable_captionbooleanBurn in captions.
Predefinito: false
disable_music_trackbooleanRemove background music from the source video.
Predefinito: false
enable_dynamic_durationbooleanAllow the video length to follow the new audio.
Predefinito: true
enable_speech_enhancementbooleanEnhance the replacement audio.
Predefinito: false
{
"model": "heygen/lipsync/precision",
"audio": "https://v3.fal.media/files/rabbit/Ql3ade3wEKlZXRQLRbhxm_tts.mp3",
"video": "https://media.sandbase.ai/files/922d1013-9018-4956-a39d-d0859149ba76/0.mp4",
"enable_caption": false,
"disable_music_track": false,
"enable_dynamic_duration": true,
"enable_speech_enhancement": false
}Un run completato espone il risultato in output. Quanto segue è l'esempio salvato del modello, non una nuova generazione.
[
{
"poster": "https://static.sandbase.ai/examples/posters/160849037f6b829828c6.jpg",
"source": "heygen schema mirror",
"source_url": "https://heygen.example/",
"url": "https://static.sandbase.ai/examples/3c0d2094-8315-4f9f-bfbd-1a209d8ab9e0/output/2c878a19-1725-4c94-adc2-1a59986d8302.mp4"
}
]