Motion ControlKling
Kling 2.6 动作控制
kwaivgi/kling-v2.6/motion-control
Kling 2.6 动作控制可将参考动作片段(舞蹈、动作、手势)转换为流畅逼真的动画。上传角色图片(或源视频)和动作视频,模型会在保持身份和时间一致性的同时转移动作。
示例
参数
| 名称 | 类型 | 默认 | 约束 | 说明 |
|---|---|---|---|---|
| image *角色图片 | image_upload | — | image/jpeg,image/jpg,image/png · 0–1 items | 上传角色图片。支持格式:.jpg/.jpeg/.png。最大文件大小:10MB。最小尺寸:300x300px。宽高比:1:2.5 到 2.5:1。 |
| character_orientation角色来源 | select | image | image | video | 选择使用图片还是视频作为角色来源。 |
| prompt提示词 | text | — | ≤ 500 chars | 可选的正向提示词。 |
| negative_prompt负向提示词 | text | — | ≤ 500 chars | 可选的负向提示词。 |
| resolution生成模式 | select | 1080P | 720P | 1080P | |
| keep_original_sound保留原始声音 | boolean | true | — | 是否在输出中保留原始视频的声音。 |
API
通过统一 REST API 调用本模型;在 API Keys 页获取密钥。
cURL
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/kwaivgi/kling-v2.6/motion-control" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"image": [
"https://assets.namifusion.com/uploads/image/e6d71928-36de-4d71-a26c-9b1b427a6dfd/2026-03-27/0847e5142a20.jpg?imageMogr2/thumbnail/600x/format/webp/quality/85"
],
"character_orientation": "image",
"resolution": "1080P",
"keep_original_sound": true
}
}'
# 2) Poll until status is "completed", then read the output URLs
curl "https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID" \
-H "Authorization: Bearer YOUR_API_KEY"Python
import time, requests
API_KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# 1) Submit
resp = requests.post(
"https://www.namifusion.com/api/v1/marketplace/run/kwaivgi/kling-v2.6/motion-control",
headers=HEADERS,
json={
"input": {
"image": [
"https://assets.namifusion.com/uploads/image/e6d71928-36de-4d71-a26c-9b1b427a6dfd/2026-03-27/0847e5142a20.jpg?imageMogr2/thumbnail/600x/format/webp/quality/85"
],
"character_orientation": "image",
"resolution": "1080P",
"keep_original_sound": True
}
},
)
resp.raise_for_status() # 401/402/429/5xx stop here instead of polling a bad task
task = resp.json()
# 2) Poll until a terminal state (completed / failed / cancelled).
# This model is allowed up to 600s server-side.
deadline = time.time() + 660
while task.get("status") not in ("completed", "failed", "cancelled"):
if time.time() > deadline:
raise TimeoutError(f"still {task.get('status')} — keep the task_uuid and poll later")
time.sleep(3)
poll = requests.get(f"https://www.namifusion.com/api/v1/marketplace/run/tasks/{task['task_uuid']}", headers=HEADERS)
poll.raise_for_status()
task = poll.json()
print(task["status"], task.get("output"))JavaScript
const API_KEY = "YOUR_API_KEY";
const HEADERS = { Authorization: `Bearer ${API_KEY}` };
// 1) Submit
const resp = await fetch("https://www.namifusion.com/api/v1/marketplace/run/kwaivgi/kling-v2.6/motion-control", {
method: "POST",
headers: { ...HEADERS, "Content-Type": "application/json" },
body: JSON.stringify({
"input": {
"image": [
"https://assets.namifusion.com/uploads/image/e6d71928-36de-4d71-a26c-9b1b427a6dfd/2026-03-27/0847e5142a20.jpg?imageMogr2/thumbnail/600x/format/webp/quality/85"
],
"character_orientation": "image",
"resolution": "1080P",
"keep_original_sound": true
}
}),
});
if (!resp.ok) throw new Error(`submit failed: ${resp.status} ${await resp.text()}`);
let task = await resp.json();
// 2) Poll until a terminal state (completed / failed / cancelled).
// This model is allowed up to 600s server-side.
const deadline = Date.now() + 660 * 1000;
while (!["completed", "failed", "cancelled"].includes(task.status)) {
if (Date.now() > deadline) throw new Error(`still ${task.status} — keep the task_uuid and poll later`);
await new Promise((r) => setTimeout(r, 3000));
const poll = await fetch(`https://www.namifusion.com/api/v1/marketplace/run/tasks/${task.task_uuid}`, { headers: HEADERS });
if (!poll.ok) throw new Error(`poll failed: ${poll.status}`);
task = await poll.json();
}
console.log(task.status, task.output);文档
NamiFusion Kling 2.6 Pro Motion Control
AI 动作控制视频生成:上传角色图片和动作参考视频,生成保留角色身份的动画视频。
NamiFusion Kling 2.6 Pro Motion Control 是一项专为动作迁移场景设计的视频生成服务。它接受角色图片和动作参考视频,将参考视频中的舞蹈、动作或姿态迁移到目标角色上,输出具有更好身份一致性和时序连贯性的结果视频。
核心功能
- 动作迁移: 将参考视频中的肢体动作迁移到目标角色,适用于舞蹈、表演和动作展示场景。
- 角色一致性: 以角色图片作为生成视频的视觉主体,尽可能保留人物的外貌和身份特征。
- 可选提示词控制: 支持
prompt和negative_prompt,为风格和不期望内容提供额外引导。 - 异步任务: 提交后返回
task_uuid,可通过轮询获取处理状态和最终结果。
技术规格
| 参数 | 详情 |
|---|---|
| 模型 ID | kwaivgi/kling-v2.6-pro/motion-control |
| 请求方式 | 异步 POST(提交任务 + 轮询结果) |
| 输入 | 角色图片 URL + 动作参考视频 URL |
| 输出 | 生成视频 URL |
| 处理时间 | 通常为数十秒至数分钟,最大轮询等待时间为 10 分钟 |
| 计费标准 | $0.112 / 秒 (720P), $0.112 / 秒 (1080P),最低按 3 秒计费 |
快速开始
API 端点
| 端点 | 方法 | 描述 |
|---|---|---|
/api/v1/marketplace/run/kwaivgi/kling-v2.6/motion-control | POST | 提交动作控制任务 |
/api/v1/marketplace/run/tasks/{task_uuid} | GET | 查询任务状态和结果 |
鉴权
在请求头中包含您的 API Key:
X-API-Key: sk-your-api-key
使用示例
第一步:提交任务
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/kwaivgi/kling-v2.6/motion-control" \
-H "X-API-Key: sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"input": {
"image": "https://static.example.com/character.png",
"video": "https://static.example.com/motion.mp4",
"character_orientation": "image",
"prompt": "full body, natural motion, cinematic lighting",
"negative_prompt": "blur, distortion, extra limbs, low quality",
"resolution": "720P",
"keep_original_sound": true
}
}'
响应示例:
{
"task_uuid": "443ea3cd-4025-40d2-901f-ef18970dbc43",
"status": "pending",
"cost_credits": 0
}
第二步:轮询任务状态
curl -X GET "https://www.namifusion.com/api/v1/marketplace/run/tasks/443ea3cd-4025-40d2-901f-ef18970dbc43" \
-H "X-API-Key: sk-your-api-key"
处理中:
{
"task_uuid": "443ea3cd-4025-40d2-901f-ef18970dbc43",
"status": "processing"
}
已完成:
{
"task_uuid": "443ea3cd-4025-40d2-901f-ef18970dbc43",
"model_id": "kwaivgi/kling-v2.6-pro/motion-control",
"status": "completed",
"output": {
"video_url": "https://cdn.example.com/results/kling_motion_control_output.mp4"
},
"cost_credits": 0,
"created_at": "2026-03-27T11:40:00Z",
"completed_at": "2026-03-27T11:41:20Z"
}
Python 示例
import requests
import time
API_KEY = "sk-your-api-key"
BASE_URL = "https://www.namifusion.com/api/v1/marketplace/run"
HEADERS = {
"X-API-Key": API_KEY,
"Content-Type": "application/json",
}
payload = {
"input": {
"image": "https://static.example.com/character.png",
"video": "https://static.example.com/motion.mp4",
"character_orientation": "image",
"prompt": "full body, natural motion, cinematic lighting",
"negative_prompt": "blur, distortion, extra limbs, low quality",
"resolution": "720P",
"keep_original_sound": True,
}
}
submit_resp = requests.post(
f"{BASE_URL}/kwaivgi/kling-v2.6/motion-control",
headers=HEADERS,
json=payload,
)
submit_resp.raise_for_status()
task = submit_resp.json()
task_uuid = task["task_uuid"]
print(f"任务已提交:{task_uuid}")
while True:
status_resp = requests.get(
f"{BASE_URL}/tasks/{task_uuid}",
headers=HEADERS,
)
status_resp.raise_for_status()
result = status_resp.json()
status = result["status"]
print(f"状态:{status}")
if status == "completed":
print("结果:", result["output"]["video_url"])
break
if status == "failed":
print("失败:", result.get("error_message", "未知错误"))
break
time.sleep(5)
详细参数与返回值
请求参数
请求体为 JSON 格式,所有参数放在 input 对象内:
{
"input": {
"image": "https://...",
"video": "https://...",
"character_orientation": "image",
"prompt": "full body, natural motion",
"negative_prompt": "blur, low quality",
"keep_original_sound": true
}
}
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
image | string | 是 | - | 角色图片 URL。支持 .jpg、.jpeg 和 .png,最大文件大小 10MB,最小尺寸 300x300,宽高比范围 1:2.5 至 2.5:1。 |
video | string | 是 | - | 动作参考视频 URL。支持 .mp4 和 .mov,最大文件大小 10MB,最小尺寸 300x300,宽高比范围 1:2.5 至 2.5:1。 |
character_orientation | string | 否 | "image" | 角色来源类型。当前模型配置默认使用 image。支持值:image、video。 |
prompt | string | 否 | null | 可选正向提示词,用于描述动作风格、镜头氛围、角色表情等引导信息。最大长度 500 字符。 |
negative_prompt | string | 否 | null | 可选负向提示词,用于约束不期望的内容。最大长度 500 字符。 |
keep_original_sound | boolean | 否 | true | 是否保留动作参考视频中的原始音频。 |
任务状态
提交任务后,通过轮询查询状态,建议轮询间隔为 5 秒:
| 状态 | 描述 |
|---|---|
pending | 任务已创建,等待处理。 |
processing | 任务正在处理中。 |
completed | 任务已完成,结果视频 URL 可从 output.video_url 获取。 |
failed | 任务失败,请查看 error_message 了解原因。 |
返回值结构
任务提交响应
| 字段 | 类型 | 描述 |
|---|---|---|
task_uuid | string | 唯一任务标识符,用于后续状态查询。 |
status | string | 初始任务状态,通常为 pending。 |
cost_credits | number | 本次任务消耗的积分。 |
任务完成响应
| 字段 | 类型 | 描述 |
|---|---|---|
task_uuid | string | 唯一任务标识符。 |
model_id | string | 模型 ID(kwaivgi/kling-v2.6-pro/motion-control)。 |
status | string | 任务状态。 |
output.video_url | string | 生成结果视频 URL。 |
cost_credits | number | 消耗的积分。 |
created_at | string | 任务创建时间(ISO 8601)。 |
completed_at | string | 任务完成时间(ISO 8601)。 |
error_message | string | 错误信息,仅在 failed 时返回。 |
参数对输出的影响
| 参数 | 对输出的影响 |
|---|---|
image | 决定最终视频中主角的外貌。建议使用无遮挡、构图完整的清晰角色图片。 |
video | 提供动作轨迹和节奏参考。动作越清晰、主体越突出,迁移结果通常越稳定。 |
prompt | 为镜头风格、动作氛围、服装细节或场景倾向添加引导,但不会替代参考动作本身。 |
negative_prompt | 有助于减少模糊、变形、多余肢体和低质量细节等问题。 |
keep_original_sound: true | 输出视频尽可能保留参考视频的原始音频,更适合舞蹈和表演场景。 |
keep_original_sound: false | 输出视频不保留参考视频的原始音频,更适合后期音频替换或剪辑。 |
注意事项
- 输入 URL 必须可公开访问:
image和video均应为服务器可直接下载的公开 URL。 - 建议使用图片作为角色输入: 当前模型配置默认为
character_orientation: "image",这也是最稳定、定义最清晰的集成方式。 - 保持提示词简洁具体:
prompt和negative_prompt作为补充引导效果最佳,避免堆叠过多相互冲突的描述。 - 建议轮询间隔为 5 秒: 本模型采用异步任务处理,每 5 秒查询一次任务状态,最大等待时间为 600 秒。
- 结果字段为单个视频 URL: 任务完成后,从
output.video_url读取结果,而非类似videos的数组字段。