Kling 4.0 Image to Video

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

Animate a first frame with optional last and ordered middle frames; up to 10 frames in total, 3–30 seconds, 720p or 1080p.

Examples

Kling 4.0 Image to Video Examples 1

Parameters

NameTypeDefaultConstraintsDescription
image *Start frameimage_upload—image/jpeg,image/png · 1–1 itemsFirst frame image. Supports JPG, JPEG and PNG.
promptPrompttextarea—≤ 5000 charsText prompt describing the motion (may be empty).
last_imageLast frameimage_upload—image/* · 0–1 itemsLast frame image URL. Requires image.
keyframesOrdered middle framesimage_upload—image/* · 0–9 itemsOrdered middle frames. A first frame is required; first, last and middle frames together accept up to 10 images.
resolutionResolutionselect720p720p | 1080pOutput resolution.
durationDurationselect53 ~ 30 · step 1 · 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | …The duration of the generated video in seconds (3-30).
aspect_ratioAspect ratioselect—16:9 | 9:16 | 1:1 | 21:9Output aspect ratio. Omit to follow the first frame.

Output fields

FieldTypeDescription
videosarray<string>Generated video URLs.

API

Call this model through one unified REST API. Get a key on the API Keys page.

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);

Documentation

Kling 4.0 · Image to Video

Animate a first-frame image into a 3–30 second video with native stereo audio. An optional last frame and ordered middle frames guide the progression.

Inputs

  • image: required URL array containing exactly one first-frame image. Use JPG, JPEG or PNG.
  • prompt: optional string; may be omitted or empty.
  • last_image: optional URL array with at most one last-frame image.
  • keyframes: optional ordered image-URL array, at most 9 items; at most 8 when last_image is supplied.
  • resolution: "720p" (default) or "1080p".
  • duration: integer from 3 through 30, default 5.
  • aspect_ratio: optional "16:9", "9:16", "1:1" or "21:9". Omit to follow the first image; do not send "auto".

Limits and references

The first image, last image and keyframes together must not exceed 10 images. Middle frames are used in array order. Describe motion and sound in prompt; no separate sound toggle is exposed.

List price and initial credit charge

720p: $0.157 per output second. 1080p: $0.235 per output second.

Cost = output seconds × resolution rate. A 5-second clip costs $0.785 at 720p or $1.175 at 1080p.

1 USD = 100 Nami credits. Round the total charge upward to 0.01 credit: credits = ceil(cost_usd × 10000) / 100. These are list prices; no promotional discount is applied.

First, last and middle images do not add separate charges.

MaaS mapping

Nami image[0] → MaaS image string; last_image[0] → last_image string. keyframes remains a string array. Omit absent optional image fields. All other named fields retain their names in MaaS. Send duration as an integer and keep_original_sound as a boolean where supported. Array order is preserved.

Nami API

Send a POST request with Authorization: Bearer YOUR_NAMI_API_KEY and Content-Type: application/json to:

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

Example request body:

{
  "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
  }
}

Replace example.com URLs with publicly accessible media URLs. Use the returned task_uuid to poll GET https://www.namifusion.com/api/v1/marketplace/run/tasks/{task_uuid} with the same authorization. On success, read generated video URLs from output.videos.

Related models

xAI Grok Imagine Video v1.5 Image to Video
Image to VideoX Ai

xAI Grok Imagine Video v1.5 Image to Video

Animate one input image with a text prompt into a 1-15 second video at 480p or 720p.

from $0.850 / per run
Vidu Q4 Preview Image to Video
Image to VideoVidu

Vidu Q4 Preview Image to Video

Generate a 3–16 second video from a prompt and one image, with optional audio and prompt expansion. Supports 540p, 720p, 1080p, 2k and 4k.

from $0.475 / per run
vidu/q3/image-to-video-spicy
Image to VideoVidu

vidu/q3/image-to-video-spicy

Vidu Q3 Image-to-Video Spicy generates unlimited high-quality videos from images with smooth animations and diverse motion, optimized for scalable content generation. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

from $0.750 / per run
Vidu Q3 Image To Video
Image to VideoVidu

Vidu Q3 Image To Video

Vidu Q3 Image-to-Video turns text prompts into high-quality videos with exceptional visual fidelity and diverse motion. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

from $0.750 / per run
MiniMax H3 Spicy Image to Video
Image to VideoMinimax

MiniMax H3 Spicy Image to Video

Animate a first-frame image with optional prompt and last-frame guidance. Supports 480p, 540p, 768p and 1080p video, with durations from 3 to 15 seconds.

from $0.200 / per run
MiniMax H3 Image to Video
Image to VideoMinimax

MiniMax H3 Image to Video

MiniMax H3 Image to Video animates a first-frame image into a coherent 2K video, with natural-language motion instructions and optional last-frame control for consistent motion, scene continuity, and cinematic video generation. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

from $0.650 / per run
MiniMax H3 Singularity Image-to-Video LoRA
Image to VideoMinimax H3 Singularity

MiniMax H3 Singularity Image-to-Video LoRA

Generate videos with native stereo audio, 3–15 second durations and four resolution tiers. Supports custom LoRAs.

from $0.3125 / per run
MiniMax H3 Singularity Image-to-Video
Image to VideoMinimax H3 Singularity

MiniMax H3 Singularity Image-to-Video

Generate videos with native stereo audio, 3–15 second durations and four resolution tiers.

from $0.250 / per run