Motion ControlKling

Kling 2.6 动作控制

kwaivgi/kling-v2.6/motion-control

Kling 2.6 动作控制可将参考动作片段(舞蹈、动作、手势)转换为流畅逼真的动画。上传角色图片(或源视频)和动作视频,模型会在保持身份和时间一致性的同时转移动作。

示例

Kling 2.6 动作控制 example 1

参数

名称类型默认约束说明
image *角色图片image_uploadimage/jpeg,image/jpg,image/png · 0–1 items上传角色图片。支持格式:.jpg/.jpeg/.png。最大文件大小:10MB。最小尺寸:300x300px。宽高比:1:2.5 到 2.5:1。
character_orientation角色来源selectimageimage | video选择使用图片还是视频作为角色来源。
prompt提示词text≤ 500 chars可选的正向提示词。
negative_prompt负向提示词text≤ 500 chars可选的负向提示词。
resolution生成模式select1080P720P | 1080P
keep_original_sound保留原始声音booleantrue是否在输出中保留原始视频的声音。

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 是一项专为动作迁移场景设计的视频生成服务。它接受角色图片和动作参考视频,将参考视频中的舞蹈、动作或姿态迁移到目标角色上,输出具有更好身份一致性和时序连贯性的结果视频。


核心功能

  • 动作迁移: 将参考视频中的肢体动作迁移到目标角色,适用于舞蹈、表演和动作展示场景。
  • 角色一致性: 以角色图片作为生成视频的视觉主体,尽可能保留人物的外貌和身份特征。
  • 可选提示词控制: 支持 promptnegative_prompt,为风格和不期望内容提供额外引导。
  • 异步任务: 提交后返回 task_uuid,可通过轮询获取处理状态和最终结果。

技术规格

参数详情
模型 IDkwaivgi/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-controlPOST提交动作控制任务
/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
  }
}
参数类型必填默认值描述
imagestring-角色图片 URL。支持 .jpg.jpeg.png,最大文件大小 10MB,最小尺寸 300x300,宽高比范围 1:2.52.5:1
videostring-动作参考视频 URL。支持 .mp4.mov,最大文件大小 10MB,最小尺寸 300x300,宽高比范围 1:2.52.5:1
character_orientationstring"image"角色来源类型。当前模型配置默认使用 image。支持值:imagevideo
promptstringnull可选正向提示词,用于描述动作风格、镜头氛围、角色表情等引导信息。最大长度 500 字符。
negative_promptstringnull可选负向提示词,用于约束不期望的内容。最大长度 500 字符。
keep_original_soundbooleantrue是否保留动作参考视频中的原始音频。

任务状态

提交任务后,通过轮询查询状态,建议轮询间隔为 5 秒:

状态描述
pending任务已创建,等待处理。
processing任务正在处理中。
completed任务已完成,结果视频 URL 可从 output.video_url 获取。
failed任务失败,请查看 error_message 了解原因。

返回值结构

任务提交响应

字段类型描述
task_uuidstring唯一任务标识符,用于后续状态查询。
statusstring初始任务状态,通常为 pending
cost_creditsnumber本次任务消耗的积分。

任务完成响应

字段类型描述
task_uuidstring唯一任务标识符。
model_idstring模型 ID(kwaivgi/kling-v2.6-pro/motion-control)。
statusstring任务状态。
output.video_urlstring生成结果视频 URL。
cost_creditsnumber消耗的积分。
created_atstring任务创建时间(ISO 8601)。
completed_atstring任务完成时间(ISO 8601)。
error_messagestring错误信息,仅在 failed 时返回。

参数对输出的影响

参数对输出的影响
image决定最终视频中主角的外貌。建议使用无遮挡、构图完整的清晰角色图片。
video提供动作轨迹和节奏参考。动作越清晰、主体越突出,迁移结果通常越稳定。
prompt为镜头风格、动作氛围、服装细节或场景倾向添加引导,但不会替代参考动作本身。
negative_prompt有助于减少模糊、变形、多余肢体和低质量细节等问题。
keep_original_sound: true输出视频尽可能保留参考视频的原始音频,更适合舞蹈和表演场景。
keep_original_sound: false输出视频不保留参考视频的原始音频,更适合后期音频替换或剪辑。

注意事项

  1. 输入 URL 必须可公开访问: imagevideo 均应为服务器可直接下载的公开 URL。
  2. 建议使用图片作为角色输入: 当前模型配置默认为 character_orientation: "image",这也是最稳定、定义最清晰的集成方式。
  3. 保持提示词简洁具体: promptnegative_prompt 作为补充引导效果最佳,避免堆叠过多相互冲突的描述。
  4. 建议轮询间隔为 5 秒: 本模型采用异步任务处理,每 5 秒查询一次任务状态,最大等待时间为 600 秒。
  5. 结果字段为单个视频 URL: 任务完成后,从 output.video_url 读取结果,而非类似 videos 的数组字段。