audiostring必填
Input audio URL.
heygen/lipsync/speedHeyGen v3 Lipsync (speed) replaces the speech in a video and re-syncs the speaker's lips to the new audio.
試用這個模型
接下來您想做什麼?
選擇一個範例,將其輸入與結果載入 playground。
{
"audio": "https://static.sandbase.ai/examples/9b13681f-6405-4dbd-a183-2a0fddbabd85/input/a3934ad5-5119-4370-af54-46fa9b7c78fc.mp3",
"video": "https://static.sandbase.ai/examples/9b13681f-6405-4dbd-a183-2a0fddbabd85/input/e707ebac-4cf5-4c73-8ce1-f159ca1919e3.mp4"
}HeyGen Lipsync (speed) replaces the speech in a video and re-syncs the speaker's lips to new audio. Speed is faster and cheaper.
| 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.05 per output second. The quote before submission assumes 5 seconds.
| Output | Price |
|---|---|
| 5s | $0.25 |
| 30s | $1.50 |
| 60s | $3.00 |
Failed runs are not charged.
Related: heygen/lipsync/precision, sync/lipsync/3.0/video-to-video.
開始建置
透過 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/speed",
"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"建立 SandBase API 金鑰,並將其設定在伺服器環境中。所有請求都使用 Bearer 驗證。
export SANDBASE_API_KEY="YOUR_API_KEY"請將金鑰保留在伺服器端,不要在瀏覽器程式碼中公開,也不要提交到儲存庫。
使用此模型 ID 及其輸入,向 /v1/run 發送 POST。上方的請求範例包含提交與輪詢。
使用回傳的執行 ID 持續輪詢,直到狀態為 completed、failed 或 timeout。只有在 completed 之後才讀取輸出。
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"在模型的 image、video 或 audio 欄位中傳入可公開存取的檔案 URL。支援格式與限制會顯示在每個 Playground 輸入欄位旁。
在 Playground 中支援的圖片欄位上使用上傳或取代控制項。影片 URL 欄位可接受託管的 driving video;它們不代表支援影片上傳。
audiostring必填Input audio URL.
videostring必填Input video URL.
end_timenumberEnd time (seconds) for partial lipsync.
最小值:0
start_timenumberStart time (seconds) for partial lipsync.
最小值:0
enable_captionbooleanBurn in captions.
預設:false
disable_music_trackbooleanRemove background music from the source video.
預設:false
enable_dynamic_durationbooleanAllow the video length to follow the new audio.
預設:true
enable_speech_enhancementbooleanEnhance the replacement audio.
預設:false
{
"model": "heygen/lipsync/speed",
"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
}已完成的執行會在輸出中顯示結果。以下為模型已儲存的範例,並非新的生成結果。
[
{
"poster": "https://static.sandbase.ai/examples/posters/160849037f6b829828c6.jpg",
"source": "heygen schema mirror",
"source_url": "https://heygen.example/",
"url": "https://static.sandbase.ai/examples/9b13681f-6405-4dbd-a183-2a0fddbabd85/output/2a67ccf5-7fd4-404f-bb07-914dea67a40b.mp4"
}
]