Documentation Index
Fetch the complete documentation index at: https://api.xcompute.us/llms.txt
Use this file to discover all available pages before exploring further.
- 真人人像素材接口,通过同一入口完成三种操作
- 步骤一:创建真人认证 H5 会话,获取 h5_link 和 byted_token
- 步骤二:用户完成 H5 认证后,查询认证结果获取素材组 group_id
- 步骤三:向 group_id 批量提交真人素材进行审核
curl --request POST \
--url https://xcompute.us/v1/seedance2/real-avatar \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"callback_url": "https://example.com/callback",
"project_name": "default"
}'
{
"code": 200,
"data": {
"id": "task_01K...",
"status": "completed"
}
}
所有接口均需要使用 Bearer Token 进行认证获取 API Key:访问 API Key 管理页面 获取您的 API Key使用时在请求头中添加:Authorization: Bearer YOUR_API_KEY
请求参数
步骤一:创建真人认证会话
认证完成后的回调 URL用户完成 H5 认证后,系统会向该地址发送回调通知
任务信息
本地任务 ID,用于查询 H5 链接和 byted_token
任务状态,初始为 completed(会话创建成功)
查询该任务可获得 H5 认证链接:
GET /v1/tasks/task_01K...
{
"code": 200,
"data": {
"id": "task_01K...",
"status": "completed",
"result": {
"byted_token": "token_xxx",
"h5_link": "https://...",
"raw_response": {}
}
}
}
步骤二:查询真人认证结果
从步骤一任务结果中获取的认证令牌用户完成 H5 认证后,通过 GET /v1/tasks/{id} 查询任务获取 byted_token,再用此字段查询认证结果,拿到真人素材组 GroupId
步骤三:批量提交真人素材
真人素材组 ID从步骤二认证结果中获取的 GroupId
素材类型可选值:
Video - 视频素材(默认,推荐用于真人人像)
Image - 图片素材
默认值:Video
素材列表,支持一次提交多个素材
示例:{
"assets": [
{
"url": "https://example.com/avatar-a.png",
"name": "avatar-a"
},
{
"url": "https://example.com/avatar-b.png",
"name": "avatar-b"
}
]
}
素材审核任务信息
任务对象类型,固定为 seedance.avatar.asset.task
查询审核结果
素材提交后为异步审核任务,使用 获取任务状态 接口查询:
全部通过
{
"code": 200,
"data": {
"id": "task_01K...",
"status": "completed",
"progress": 100,
"result": {
"assets": [
{
"asset_id": "asset_a",
"asset_url": "asset://asset_a",
"status": "Active"
},
{
"asset_id": "asset_b",
"asset_url": "asset://asset_b",
"status": "Active"
}
],
"usable_assets": [
{
"asset_id": "asset_a",
"asset_url": "asset://asset_a",
"status": "Active"
},
{
"asset_id": "asset_b",
"asset_url": "asset://asset_b",
"status": "Active"
}
],
"failed_assets": []
}
}
}
部分失败
{
"code": 200,
"data": {
"id": "task_01K...",
"status": "failed",
"progress": 100,
"result": {
"assets": [
{
"asset_id": "asset_a",
"asset_url": "asset://asset_a",
"status": "Active"
},
{
"asset_id": "asset_b",
"asset_url": "asset://asset_b",
"status": "Failed"
}
],
"usable_assets": [
{
"asset_id": "asset_a",
"asset_url": "asset://asset_a",
"status": "Active"
}
],
"failed_assets": [
{
"asset_id": "asset_b",
"asset_url": "asset://asset_b",
"status": "Failed"
}
]
},
"error": {
"code": "task_failed",
"message": "部分素材审核失败"
}
}
}
result.usable_assets[].asset_url 可直接用于 Seedance 2.0 视频生成
result.failed_assets 中的素材需更换源文件或重新提交
审核后使用素材
审核通过后,将 asset://... URL 直接传入 Seedance 2.0 视频生成 接口:
{
"model": "doubao-seedance-2.0-face",
"prompt": "使用参考人像生成视频",
"image_with_roles": [
{
"url": "asset://asset_a",
"role": "reference_image"
}
]
}
- 真人人像素材建议配合
doubao-seedance-2.0-face 或 doubao-seedance-2.0-fast-face 模型使用
- 服务端识别到
asset:// 前缀后,会直接提交官方生成任务,不会再次触发素材审核