如何创建数字人
用一张人像图和一段音频生成会说话的数字人视频。数字人的唇形动作和表情会与音频同步。
快速开始
这类任务较慢 —— 建议异步提交后轮询:
bash
curl -X POST "https://api.get3w.com/v1/bytedance/omnihuman-1.5/digital-human" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://your-cdn.com/portrait.png",
"audio_url": "https://your-cdn.com/speech.mp3"
}'python
import time
import requests
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
task = requests.post(
"https://api.get3w.com/v1/bytedance/omnihuman-1.5/digital-human",
headers=headers,
json={
"image_url": "https://your-cdn.com/portrait.png",
"audio_url": "https://your-cdn.com/speech.mp3"
}
).json()
while True:
data = requests.get(
f"https://api.get3w.com/v1/requests/{task['id']}",
headers=headers
).json()
if data["status"] == "completed":
print(data["outputs"][0])
break
if data["status"] == "failed":
print(f"Failed ({data['code']}):", data["error"])
break
time.sleep(10)可用模型
| Slug | 说明 |
|---|---|
bytedance/omnihuman-1.5/digital-human | 全身动作富有表现力 |
kling/kling-avatar-2/digital-human | 提供 standard 和 pro 通道 |
完整工作流
先生成语音,再把它的输出 URL 传给数字人模型:
python
import time
import requests
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
speech = requests.post(
"https://api.get3w.com/v1/elevenlabs/eleven-3/text-to-speech?sync=true",
headers=headers,
json={"text": "Hello, welcome to our product demo."}
).json()
audio_url = speech["outputs"][0]
task = requests.post(
"https://api.get3w.com/v1/bytedance/omnihuman-1.5/digital-human",
headers=headers,
json={
"image_url": "https://your-cdn.com/portrait.png",
"audio_url": audio_url
}
).json()
while True:
data = requests.get(
f"https://api.get3w.com/v1/requests/{task['id']}",
headers=headers
).json()
if data["status"] in ("completed", "failed"):
print(data["status"], data.get("outputs") or data.get("error"))
break
time.sleep(10)一个任务的输出 URL 可以直接作为下一个任务的输入 —— 无需重新上传。
小技巧
- 正面人像 —— 画面清晰、光照充足、面部无遮挡
- 干净的音频 —— 背景噪声会降低唇形同步的准确度
- 起始表情保持中性 —— 给模型留出更多表演空间
- 先做短的 —— 这是最贵的 run type 之一,先用短片段验证效果
- URL 必须公网可访问 —— 两个输入都由供应商抓取,无法访问的 URL 会以
1402失败