imagesarray
Up to 10 reference images, referenced as @Image1, @Image2, ...
kwaivgi/kling-video/v4/flash/reference-to-videoKling V4 Flash Reference to Video by Kuaishou generates a 3-20 second 720p video that keeps characters, objects and motion from reference images and videos.
Thử model
PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 10
Bạn muốn làm gì tiếp theo?
Chọn một ví dụ để nạp đầu vào và kết quả của nó vào playground.
{
"aspect_ratio": "16:9",
"images": [
"https://static.sandbase.ai/examples/876cfe40-c2cf-4869-91fb-457ac514139b/input/3f37b438-31f7-40e3-83a2-f07ca1a7a364.png",
"https://static.sandbase.ai/examples/876cfe40-c2cf-4869-91fb-457ac514139b/input/34423a11-3143-42fa-b016-f38ffd07ec35.png",
"https://static.sandbase.ai/examples/876cfe40-c2cf-4869-91fb-457ac514139b/input/475de517-faa0-4318-a194-ea7679683fe3.png",
"https://static.sandbase.ai/examples/876cfe40-c2cf-4869-91fb-457ac514139b/input/54f8f7ad-2075-49c6-a036-7d29525b5fd0.png"
],
"prompt": "Macro product film for the watchmaker AUREL on black velvet under one raking strip light. @Image1 is the dial, @Image2 the movement seen through the caseback, @Image3 the case flank, @Image4 the strap. Slow precise shots with hard cuts: the dial with the seconds hand sweeping, the balance wheel ticking through the caseback, light gliding along the brushed case flank, then the full watch resting on velvet. Quiet mechanical ticking."
}{
"aspect_ratio": "16:9",
"images": [
"https://static.sandbase.ai/examples/2ecd270c-9080-436a-ac22-336247bcebbb/input/ca6f413c-eb10-4c28-ab93-6f4f50e5a71a.png"
],
"prompt": "The sneaker from @Image1 bounces off wet city pavement in slow motion, splashing puddle water, then lands as a runner's foot steps into frame at sunrise. Street ambience and footsteps."
}Kling V4 Flash reference-to-video keeps characters, objects and motion from reference images and videos in a new 3–20 second 720p clip.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Refer to inputs as @Image1, @Video1, … |
images | image URL[] | — | Up to 10 reference images. |
videos | video URL[] | — | Up to 5 reference videos, 3–20s each, 20s combined. |
aspect_ratio | 21:9 / 16:9 / 9:16 / 1:1 | — | Leave empty to follow the references. |
duration | 3–20 | 5 | Output length in seconds. |
Without reference videos: $0.094 per output second. With reference videos: $0.063 per second of output plus input, where the input side counts at least as long as the output. The quote before submission assumes 20 seconds of reference video when the length cannot be read.
| Request | Price |
|---|---|
| 5s, images only (default) | $0.47 |
| 10s, images only | $0.94 |
| 5s, 8s reference video | $0.819 |
| 10s, 4s reference video | $1.26 |
| Failed runs are not charged. |
voice_ids) are only on kwaivgi/kling-video/v4/reference-to-video.Other Kling V4 Flash endpoints: kwaivgi/kling-video/v4/flash/text-to-video, kwaivgi/kling-video/v4/flash/image-to-video, kwaivgi/kling-video/v4/flash/reference-to-video, kwaivgi/kling-video/v4/flash/video-edit. For 1080p or clips up to 30 seconds, use Kling V4 (kwaivgi/kling-video/v4/text-to-video and its siblings).
Bắt đầu xây dựng
Gửi model này qua 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/v4/flash/reference-to-video",
"prompt": "@Element1 and @Element2 are having dinner at the table in @Image1",
"duration": 5
}
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"Tạo một SandBase API key và đặt nó trong môi trường máy chủ của bạn. Tất cả request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key trên máy chủ. Không hiển thị trong mã trình duyệt hoặc commit vào repository.
POST tới /v1/run với model ID này và các đầu vào của nó. Ví dụ request ở trên bao gồm cả bước gửi và polling.
Dùng run ID được trả về để poll cho đến khi trạng thái là completed, failed hoặc timeout. Chỉ đọc đầu ra sau khi completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Cung cấp một URL tệp có thể truy cập công khai trong trường image, video hoặc audio của model. Các định dạng và giới hạn được hỗ trợ hiển thị bên cạnh từng input trong Playground.
Dùng điều khiển upload hoặc replace trên các trường image được hỗ trợ trong Playground. Trường URL video chấp nhận một video driving được host; điều này không đồng nghĩa hỗ trợ tải lên video.
imagesarrayUp to 10 reference images, referenced as @Image1, @Image2, ...
promptstringbắt buộcText prompt. Refer to references as @Image1, @Video1, ...
videosarrayUp to 5 reference videos (3-20s each, 20s combined), referenced as @Video1, ... Video references switch to the input-plus-output price.
durationintegerOutput length in seconds (3-20).
Mặc định: 5
Tối thiểu: 3
Tối đa: 20
aspect_ratiostringOutput frame shape. Leave empty to follow the references (adaptive).
Giá trị có thể dùng: "21:9", "16:9", "9:16", "1:1"
{
"model": "kwaivgi/kling-video/v4/flash/reference-to-video",
"prompt": "@Element1 and @Element2 are having dinner at the table in @Image1",
"duration": 5
}Một run đã hoàn tất sẽ hiển thị kết quả trong output. Phần sau là ví dụ đã lưu của model, không phải một lần tạo mới.
[
{
"url": "https://static.sandbase.ai/examples/876cfe40-c2cf-4869-91fb-457ac514139b/output/1a4f7442-8e80-42f1-bc60-d406f0829c20.mp4"
}
]