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.
model को आज़माएँ
PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 10
आप आगे क्या करना चाहेंगे?
प्लेग्राउंड में इसके इनपुट और परिणाम लोड करने के लिए कोई उदाहरण चुनें।
{
"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).
बिल्डिंग शुरू करें
इस model को 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"एक SandBase API key बनाएँ और इसे अपने server environment में सेट करें। सभी requests Bearer authentication का उपयोग करती हैं।
export SANDBASE_API_KEY="YOUR_API_KEY"Key को सर्वर पर रखें। इसे browser code में expose न करें या repository में commit न करें।
इस model ID और इसके inputs के साथ /v1/run पर POST करें। ऊपर दिया गया request example submission और polling दोनों शामिल करता है।
Completed, failed या timeout होने तक poll करने के लिए लौटाए गए run ID का उपयोग करें। Output केवल completed होने के बाद पढ़ें।
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Model के image, video या audio field में सार्वजनिक रूप से उपलब्ध फ़ाइल URL पास करें। समर्थित formats और limits प्रत्येक Playground input के पास दिखाए गए हैं।
Playground में समर्थित image fields पर upload या replace control का उपयोग करें। Video URL fields hosted driving video स्वीकार करते हैं; इससे video-upload support का संकेत नहीं मिलता।
imagesarrayUp to 10 reference images, referenced as @Image1, @Image2, ...
promptstringआवश्यकText 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).
डिफ़ॉल्ट: 5
न्यूनतम: 3
अधिकतम: 20
aspect_ratiostringOutput frame shape. Leave empty to follow the references (adaptive).
संभावित मान: "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
}पूरा हुआ run अपना परिणाम output में दिखाता है। नीचे दिया गया model का सेव किया हुआ example है, नई generation नहीं।
[
{
"url": "https://static.sandbase.ai/examples/876cfe40-c2cf-4869-91fb-457ac514139b/output/1a4f7442-8e80-42f1-bc60-d406f0829c20.mp4"
}
]