Kling 4.0 画像から動画

kwaivgi/kling-v4.0/image-to-video

開始画像と任意の終了・中間フレーム(合計最大10枚)から3〜30秒の720pまたは1080p動画を生成します。

サンプル

Kling 4.0 画像から動画 サンプル 1

パラメータ

名前型既定制約説明
image *最初のフレームimage_upload—image/jpeg,image/png · 1–1 items最初のフレーム画像。JPG、JPEG、PNG に対応。
promptプロンプトtextarea—≤ 5000 chars動きを説明するテキストプロンプト(空欄可)。
last_image最後のフレームimage_upload—image/* · 0–1 items最後のフレーム画像の URL。画像の指定が必要です。
keyframes中間フレーム(順序付き)image_upload—image/* · 0–9 items順序付きの中間フレーム。最初のフレームが必要です。最初・最後・中間フレームの合計は最大 10 枚です。
resolution解像度select720p720p | 1080p出力解像度。
duration長さselect53 ~ 30 · step 1 · 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | …生成する動画の長さ(秒)(3〜30)。
aspect_ratioアスペクト比select—16:9 | 9:16 | 1:1 | 21:9出力動画のアスペクト比。省略すると最初のフレームに合わせます。

出力フィールド

フィールド型説明
videosarray<string>

API

統一 REST API でこのモデルを呼び出せます。API Keys ページでキーを取得してください。

cURL
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/kwaivgi/kling-v4.0/image-to-video" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "image": "https://example.com/input.jpg",
    "resolution": "720p",
    "duration": 5
  }
}'

# 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-v4.0/image-to-video",
    headers=HEADERS,
    json={
        "input": {
            "image": "https://example.com/input.jpg",
            "resolution": "720p",
            "duration": 5
        }
    },
)
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 1800s server-side.
deadline = time.time() + 1860
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-v4.0/image-to-video", {
  method: "POST",
  headers: { ...HEADERS, "Content-Type": "application/json" },
  body: JSON.stringify({
    "input": {
      "image": "https://example.com/input.jpg",
      "resolution": "720p",
      "duration": 5
    }
  }),
});
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 1800s server-side.
const deadline = Date.now() + 1860 * 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);

ドキュメント

Kling 4.0 · 画像から動画

先頭フレーム画像から3〜30秒の動画とネイティブのステレオ音声を生成します。任意の最終フレームと順序付き中間フレームで展開を指定できます。

入力パラメーター

  • image:必須のURL配列。先頭フレーム画像を1枚指定します。JPG、JPEG、PNGに対応。
  • prompt:任意の文字列。省略または空文字が可能です。
  • last_image:任意のURL配列。最終フレーム画像を最大1枚指定します。
  • keyframes:任意の順序付き画像URL配列。最大9枚、last_imageを指定する場合は最大8枚。
  • resolution:"720p"(既定)または"1080p"。
  • duration:3〜30の整数、既定は5。
  • aspect_ratio:任意で"16:9"、"9:16"、"1:1"、"21:9"。省略すると先頭画像に従います。"auto"は送信しないでください。

制限と参照方法

先頭画像、最終画像、keyframesの合計は10枚以内です。中間フレームは配列順に使用されます。動きと音はpromptで指定し、独立したsound切替はありません。

通常料金と事前のクレジット計算

720pは出力1秒あたり$0.157、1080pは$0.235です。

料金 = 出力秒数 × 解像度別単価。5秒の動画は720pで$0.785、1080pで$1.175です。

1 USD = 100 Namiクレジット。合計を0.01クレジット単位で切り上げます:クレジット = ceil(USD料金 × 10000) / 100。通常料金を使用し、期間限定割引は適用しません。

先頭・最終・中間フレーム画像の個別追加料金はありません。

MaaS へのマッピング

Namiのimage[0]をMaaSのimage文字列、last_image[0]をlast_image文字列へ変換します。keyframesは文字列配列のまま渡します。任意の画像がない場合はフィールドを省略します。 その他の記載フィールドはMaaSでも同名です。durationは整数、対応するAPIのkeep_original_soundはブール値で送信します。配列の順序は維持されます。

Nami API

Authorization: Bearer YOUR_NAMI_API_KEY と Content-Type: application/json を指定し、次のURLへPOSTします。

https://www.namifusion.com/api/v1/marketplace/run/kwaivgi/kling-v4.0/image-to-video

リクエスト本文の例:

{
  "input": {
    "image": [
      "https://example.com/first-frame.jpg"
    ],
    "last_image": [
      "https://example.com/last-frame.jpg"
    ],
    "keyframes": [
      "https://example.com/middle-frame.jpg"
    ],
    "prompt": "The person slowly turns toward the window, then smiles. Smooth camera movement and quiet room ambience.",
    "resolution": "720p",
    "duration": 5
  }
}

example.com のURLは公開アクセス可能な素材URLに置き換えてください。返されたtask_uuidを使い、同じ認証で GET https://www.namifusion.com/api/v1/marketplace/run/tasks/{task_uuid} をポーリングします。成功後、生成された動画URLの配列を output.videos から取得します。

関連モデル

xAI Grok Imagine Video v1.5 画像から動画
画像から動画X Ai

xAI Grok Imagine Video v1.5 画像から動画

1枚の入力画像とテキストプロンプトから1-15秒の動画を生成します。480pと720pに対応しています。

〜 $0.850 / 1 回
Vidu Q4 Preview 画像から動画
画像から動画Vidu

Vidu Q4 Preview 画像から動画

プロンプトと1枚の画像から3〜16秒の動画を生成します。音声生成とプロンプト拡張は任意で、540p、720p、1080p、2k、4kに対応します。

〜 $0.475 / 1 回
vidu/q3/image-to-video-spicy 画像から動画生成
画像から動画Vidu

vidu/q3/image-to-video-spicy 画像から動画生成

Vidu Q3 Image-to-Video Spicy は、画像から高品質な動画を無制限に生成でき、滑らかなアニメーションと多彩な動きが特長です。大規模なコンテンツ生成向けに最適化されています。すぐに使える REST 推論 API を提供し、高性能・コールドスタートなし・手頃な価格を実現します。

〜 $0.750 / 1 回
Vidu Q3 画像から動画へ
画像から動画Vidu

Vidu Q3 画像から動画へ

Vidu Q3 画像から動画へは、テキストプロンプトを高品質な動画に変換し、優れた視覚的忠実度と多様なモーションを実現します。すぐに使える REST 推論 API、最高のパフォーマンス、コールドスタートなし、手頃な価格。

〜 $0.750 / 1 回
MiniMax H3 Spicy 画像から動画
画像から動画Minimax

MiniMax H3 Spicy 画像から動画

開始画像から動画を生成し、任意のプロンプトと最終フレームで動きを誘導します。480p、540p、768p、1080p、3〜15秒に対応します。

〜 $0.200 / 1 回
MiniMax H3 画像から動画
画像から動画Minimax

MiniMax H3 画像から動画

MiniMax H3 Image to Video は、最初のフレーム画像を自然で一貫性のある 2K 動画にアニメーション化します。自然言語によるモーション指示に対応し、任意の最終フレーム制御によって、動きの一貫性、シーンの連続性、映画のような動画生成を実現します。すぐに使える REST 推論 API を提供し、高性能、コールドスタートなし、手頃な価格で利用できます。

〜 $0.650 / 1 回
MiniMax H3 Singularity 画像から動画生成 LoRA
画像から動画Minimax H3 Singularity

MiniMax H3 Singularity 画像から動画生成 LoRA

ネイティブステレオ音声付き動画。3–15 秒、4 段階の解像度に対応。カスタム LoRA 対応。

〜 $0.3125 / 1 回
MiniMax H3 Singularity 画像から動画生成
画像から動画Minimax H3 Singularity

MiniMax H3 Singularity 画像から動画生成

ネイティブステレオ音声付き動画。3–15 秒、4 段階の解像度に対応。

〜 $0.250 / 1 回