Kling 4.0 Image to Video

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

kwaivgi/kling-v4.0/image-to-video. Parcourez les API de modèles d’image, de vidéo et d’échange de visage. Testez un modèle puis intégrez-le avec une API REST unifiée.

Modèles associés

Kling 4.0 Image to Video Modèles associés 1

Référence complète des paramètres, schéma de sortie et tarifs actuels

Marché des API de modèles IAUne plateforme pour tout créerLe plus populaireConditionsParcourez les API de modèles d’image, de vidéo et d’échange de visage. Testez un modèle puis intégrez-le avec une API REST unifiée.
image *Start frameimage_upload—image/jpeg,image/png · 1–1 items
promptPrompttextarea—≤ 5000 chars
last_imageLast frameimage_upload—image/* · 0–1 items
keyframesOrdered middle framesimage_upload—image/* · 0–9 items
resolutionResolutionselect720p720p | 1080p
durationDurationselect53 ~ 30 · step 1 · 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | …
aspect_ratioAspect ratioselect—16:9 | 9:16 | 1:1 | 21:9

Référence complète des paramètres, schéma de sortie et tarifs actuels

En savoir plusUne plateforme pour tout créerParcourez les API de modèles d’image, de vidéo et d’échange de visage. Testez un modèle puis intégrez-le avec une API REST unifiée.
videosarray<string>

API

Parcourez les API de modèles d’image, de vidéo et d’échange de visage. Testez un modèle puis intégrez-le avec une API REST unifiée.

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 API

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.

Modèles associés

xAI Grok Imagine Video v1.5 Image to Video
Image vers vidéoX Ai

xAI Grok Imagine Video v1.5 Image to Video

x-ai/grok-imagine-video-v1.5/image-to-video. Parcourez les API de modèles d’image, de vidéo et d’échange de visage. Testez un modèle puis intégrez-le avec une API REST unifiée.

à partir de $0.850 / par exécution
Vidu Q4 Preview Image to Video
Image vers vidéoVidu

Vidu Q4 Preview Image to Video

vidu/q4-preview/image-to-video. Parcourez les API de modèles d’image, de vidéo et d’échange de visage. Testez un modèle puis intégrez-le avec une API REST unifiée.

à partir de $0.475 / par exécution
vidu/q3/image-to-video-spicy
Image vers vidéoVidu

vidu/q3/image-to-video-spicy

vidu/q3/image-to-video-spicy. Parcourez les API de modèles d’image, de vidéo et d’échange de visage. Testez un modèle puis intégrez-le avec une API REST unifiée.

à partir de $0.750 / par exécution
Vidu Q3 Image To Video
Image vers vidéoVidu

Vidu Q3 Image To Video

vidu/q3/image-to-video. Parcourez les API de modèles d’image, de vidéo et d’échange de visage. Testez un modèle puis intégrez-le avec une API REST unifiée.

à partir de $0.750 / par exécution
MiniMax H3 Spicy Image to Video
Image vers vidéoMinimax

MiniMax H3 Spicy Image to Video

minimax/h3/image-to-video-spicy. Parcourez les API de modèles d’image, de vidéo et d’échange de visage. Testez un modèle puis intégrez-le avec une API REST unifiée.

à partir de $0.200 / par exécution
MiniMax H3 Image to Video
Image vers vidéoMinimax

MiniMax H3 Image to Video

minimax/h3/image-to-video. Parcourez les API de modèles d’image, de vidéo et d’échange de visage. Testez un modèle puis intégrez-le avec une API REST unifiée.

à partir de $0.650 / par exécution
MiniMax H3 Singularity Image-to-Video LoRA
Image vers vidéoMinimax H3 Singularity

MiniMax H3 Singularity Image-to-Video LoRA

minimax-h3-singularity/image-to-video-lora. Parcourez les API de modèles d’image, de vidéo et d’échange de visage. Testez un modèle puis intégrez-le avec une API REST unifiée.

à partir de $0.3125 / par exécution
MiniMax H3 Singularity Image-to-Video
Image vers vidéoMinimax H3 Singularity

MiniMax H3 Singularity Image-to-Video

minimax-h3-singularity/image-to-video. Parcourez les API de modèles d’image, de vidéo et d’échange de visage. Testez un modèle puis intégrez-le avec une API REST unifiée.

à partir de $0.250 / par exécution