audiostringwajib
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.
Coba model ini
Apa yang ingin Anda lakukan selanjutnya?
Pilih contoh untuk memuat input dan hasilnya ke 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.
Mulai membangun
Kirim model ini melalui 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"Buat SandBase API key dan atur di environment server Anda. Semua permintaan menggunakan autentikasi Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Simpan key di server. Jangan tampilkan di kode browser atau commit ke repository.
POST ke /v1/run dengan ID model ini dan inputnya. Contoh permintaan di atas mencakup pengiriman dan polling.
Gunakan run ID yang dikembalikan untuk polling sampai status completed, failed, atau timeout. Baca output hanya setelah completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Kirim URL file yang dapat diakses publik di field image, video, atau audio model. Format dan batas yang didukung ditampilkan di samping setiap input Playground.
Gunakan kontrol upload atau replace pada field gambar yang didukung di Playground. Field URL video menerima video driving yang di-host; ini tidak berarti dukungan upload video.
audiostringwajibInput audio URL.
videostringwajibInput video URL.
end_timenumberEnd time (seconds) for partial lipsync.
Minimum: 0
start_timenumberStart time (seconds) for partial lipsync.
Minimum: 0
enable_captionbooleanBurn in captions.
Default: false
disable_music_trackbooleanRemove background music from the source video.
Default: false
enable_dynamic_durationbooleanAllow the video length to follow the new audio.
Default: true
enable_speech_enhancementbooleanEnhance the replacement audio.
Default: 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
}Run yang selesai menampilkan hasilnya di output. Berikut adalah contoh tersimpan model ini, bukan generasi baru.
[
{
"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"
}
]