imagestringจำเป็น
URL of the image to be used for the video
kwaivgi/kling-video/v2.6/pro/image-to-videoKling V2.6 Pro Image to Video by Kuaishou animates a start image, optionally toward an end image, into a 5 or 10 second 1080p video with optional native audio and voice control.
ลองใช้โมเดล
PNG, JPEG, WebP หรือ GIF · สูงสุด 20 MiB
PNG, JPEG, WebP หรือ GIF · สูงสุด 20 MiB
ต้องการทำอะไรต่อ
เลือกตัวอย่างเพื่อโหลดอินพุตและผลลัพธ์ลงใน playground
{
"image": "https://static.sandbase.ai/examples/232fd0ea-384f-46ba-8343-39f1dac143b3/input/edc1c83b-9ec7-4f43-aa2b-43c8af7fd6d2.png",
"prompt": "A king walks slowly and says \"My people, here I am! I am here to save you all\""
}Kling V2.6 Pro image-to-video with native audio. Add voice_ids to have characters speak in a chosen voice.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 2,500 characters. |
image | image URL, required | — | First frame. JPEG, PNG, or WebP URL. |
end_image | image URL | — | Optional last frame. |
duration | 5 / 10 | 5 | Output length in seconds. |
generate_audio | boolean | true | Native audio; on by default. |
voice_ids | string[] | — | Optional Kling voice IDs for spoken lines. |
Per output second: $0.07 silent, $0.14 with audio, $0.168 with audio and custom voices.
| Output | Silent | With audio | With voices |
|---|---|---|---|
| 5s (default) | $0.35 | $0.70 | $0.84 |
| 10s | $0.70 | $1.40 | $1.68 |
Failed runs are not charged.
Related: kwaivgi/kling-video/v2.6/pro/text-to-video, kwaivgi/kling-video/v3/pro/image-to-video (newer).
เริ่มสร้าง
ส่งโมเดลนี้ผ่าน SandBase Unified Run API
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "kwaivgi/kling-video/v2.6/pro/image-to-video",
"image": "https://static.sandbase.ai/examples/mirrored/b08c180c4436-BSJXz9Ht-jgRgMf4IGxLU_upscaled.png",
"prompt": "A king walks slowly and says \"My people, here I am! I am here to save you all\"",
"duration": 5,
"generate_audio": true
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"สร้าง SandBase API key และตั้งค่าไว้ในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอทั้งหมดใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์หรือคอมมิตลง repository
POST ไปที่ /v1/run ด้วย model ID นี้และอินพุตของมัน ตัวอย่างคำขอด้านบนมีทั้งการส่งและการ polling
ใช้ run ID ที่ส่งกลับมาเพื่อ polling จนกว่าสถานะจะเป็น completed, failed หรือ timeout ให้อ่าน output หลังจาก completed เท่านั้น
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"ส่ง URL ไฟล์ที่เข้าถึงได้สาธารณะในช่อง image, video หรือ audio ของโมเดล รูปแบบและข้อจำกัดที่รองรับแสดงอยู่ข้างแต่ละอินพุตใน Playground
ใช้ตัวควบคุม upload หรือ replace ในช่องรูปภาพที่รองรับใน Playground ช่อง URL ของวิดีโอรองรับวิดีโอ driving ที่โฮสต์ไว้; ไม่ได้หมายความว่าสามารถอัปโหลดวิดีโอได้
imagestringจำเป็นURL of the image to be used for the video
promptstringจำเป็นdurationintegerThe duration of the generated video in seconds
ค่าเริ่มต้น: 5
ค่าที่เป็นไปได้: 5, 10
end_imagestringURL of the image to be used for the end of the video
voice_idsarrayOptional Voice IDs for video generation. Reference voices in your prompt with <<<voice_1>>> and <<<voice_2>>> (maximum 2 voices per task). Get voice IDs from the kling video create-voice endpoint: https://fal.ai/models/fal-ai/kling-video/create-voice
generate_audiobooleanWhether to generate native audio for the video. Supports Chinese and English voice output. Other languages are automatically translated to English. For English speech, use lowercase letters; for acronyms or proper nouns, use uppercase.
ค่าเริ่มต้น: true
{
"model": "kwaivgi/kling-video/v2.6/pro/image-to-video",
"image": "https://static.sandbase.ai/examples/mirrored/b08c180c4436-BSJXz9Ht-jgRgMf4IGxLU_upscaled.png",
"prompt": "A king walks slowly and says \"My people, here I am! I am here to save you all\"",
"duration": 5,
"generate_audio": true
}run ที่เสร็จสมบูรณ์จะแสดงผลลัพธ์ใน output ต่อไปนี้เป็นตัวอย่างที่บันทึกไว้ของโมเดล ไม่ใช่การสร้างใหม่
[
{
"poster": "https://static.sandbase.ai/examples/posters/b4ded61b4d7070320bab.jpg",
"source": "Kling AI official schema mirror",
"source_url": "https://kling.ai/document-api/guides/get-started/overview",
"url": "https://static.sandbase.ai/examples/232fd0ea-384f-46ba-8343-39f1dac143b3/output/5fe0bea2-4dfc-4d2b-bf3f-9fbff0e0e48c.mp4"
}
]