@image_1、@video_1 或自定义 @名称 引用素材。prompt 中按下表引用:| 素材 | 引用写法 | 数量上限 |
|---|---|---|
参考图 images | @image_1、@image_2… | 10 张 |
参考视频 videos | @video_1、@video_2… | 5 个,单个 2–30 秒 |
主体 elements | @主 体名 | 7 个,其中视频主体最多 3 个 |
声音 voices | @声音名 | 3 个 |
image_N、video_N、first_frame、last_frame 等保留名。aspect_ratio 时,有任意参考素材则按素材自适应,无素材则使用 16:9。传入 videos 时由 keep_original_sound 决定是否保留原声,未传 videos 时原生音频默认开启。resolution 决定画面大小,dynamic_range 决定是否输出 HDR,两者独立设置。resolution | dynamic_range | 成片(16:9,MP4) |
|---|---|---|
720p | sdr | 1280×720 |
1080p | sdr | 1920×1080 |
4k | sdr | 3840×2160,H.264 8-bit |
1080p | hdr | 1920×1080,HEVC 10-bit,BT.2020,HLG |
4k | hdr | 3840×2160,HEVC 10-bit,BT.2020,HLG |
720p | hdr | 不支持,返回参数错误 |
4k 或 hdr 任务拿不到对应规格的成片时整单失败,不会退回 1080p SDR。callBackUrl 参数接收生成完成的自动通知,而非轮询状态接口。curl --location 'https://api.emix.ai/api/v1/client/tasks' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "kling-4.0/reference-to-video",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "@Hero 坐在 @video_1 的桌前,拿起 @image_1 里的玩偶,用 @Narrator 的声音打招呼",
"duration": 10,
"resolution": "1080p",
"dynamic_range": "sdr",
"image_urls": [
"https://example.com/doll.png"
],
"video_urls": [
"https://example.com/room.mp4"
],
"keep_original_sound": false,
"elements": [
{
"name": "Hero",
"image_urls": [
"https://example.com/hero-front.jpg",
"https://example.com/hero-side.jpg"
],
"tag": "character",
"description": "穿红夹克的年轻男人"
}
],
"voices": [
{
"name": "Narrator",
"audio_url": "https://example.com/narrator.mp3"
}
]
}
}'{
"code": 200,
"msg": "success",
"data": {
"taskId": "task_kling-4.0-reference-to-video_abc123"
}
}