imagestringrequired
First frame. Min 300x300 px, aspect ratio 0.4-2.5, up to 30 MB.
kwaivgi/kling-video/v4/image-to-videoKling V4 Image to Video by Kuaishou animates a start image, optionally toward an end image, into a 3-30 second video.
Try the model
PNG, JPEG, WebP, or GIF · 20 MiB maximum
Customize your input with more control.
PNG, JPEG, WebP, or GIF · 20 MiB maximum
What would you like to do next?
Select an example to load its inputs and result into the playground.
{
"image": "https://static.sandbase.ai/examples/746c1af3-e60b-4a50-a599-53df4d3da1ae/input/fae6ad50-5dc0-4015-8e2f-4ff7689f448b.png",
"prompt": "The rabbit looks around curiously, its ears twitch, then it hops toward the camera. Soft breeze moves the grass."
}{
"image": "https://static.sandbase.ai/examples/2346d3f9-1129-4a8c-a0d9-60eb2b488e9c/input/7b330c7f-26f4-4038-8198-34fc2d98051e.png",
"prompt": "The tiger slowly turns its head toward the camera and lets out a low growl, slow cinematic dolly-in."
}Kling V4 image-to-video animates a start image, optionally toward an end image, into a 3–30 second clip.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 2,500 characters. |
image | image URL, required | — | First frame. Min 300×300 px, aspect ratio 0.4–2.5, up to 30 MB. |
end_image | image URL | — | Optional last frame. |
resolution | 720p / 1080p | 1080p | Output resolution. |
duration | 3–30 | 5 | Output length in seconds. |
Billed per output second: $0.157 at 720p, $0.235 at 1080p.
| Output | Price |
|---|---|
| 5s, 1080p (default) | $1.175 |
| 5s, 720p | $0.785 |
| 10s, 1080p | $2.35 |
| 30s, 1080p | $7.05 |
| Failed runs are not charged. |
Other Kling V4 endpoints: kwaivgi/kling-video/v4/text-to-video, kwaivgi/kling-video/v4/image-to-video, kwaivgi/kling-video/v4/reference-to-video, kwaivgi/kling-video/v4/video-edit.
Start building
Submit this model through the 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/image-to-video",
"image": "https://v3b.fal.media/files/b/rabbit/NaslJIC7F2WodS6DFZRRJ.png",
"prompt": "A detective in a black trench coat stands on a rooftop in the rain, looking through a telescope at the street below.",
"duration": 5,
"end_image": "https://v3b.fal.media/files/b/tiger/BwHi22qoQnqaTNMMhe533.png",
"resolution": "1080p"
}
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"Create a SandBase API key and set it in your server environment. All requests use Bearer authentication.
export SANDBASE_API_KEY="YOUR_API_KEY"Keep the key on your server. Do not expose it in browser code or commit it to a repository.
POST to /v1/run with this model ID and its inputs. The request example above includes submission and polling.
Use the returned run ID to poll until the status is completed, failed or timeout. Read output only after completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Pass a publicly accessible file URL in the model’s image, video or audio field. Supported formats and limits are shown beside each Playground input.
Use the upload or replace control on supported image fields in the Playground. Video URL fields accept a hosted driving video; they do not imply video-upload support.
imagestringrequiredFirst frame. Min 300x300 px, aspect ratio 0.4-2.5, up to 30 MB.
promptstringrequiredDescribe subject, action, camera and light.
durationintegerOutput length in seconds (3-30).
Default: 5
Minimum: 3
Maximum: 30
end_imagestringOptional last frame.
resolutionstringOutput resolution.
Default: "1080p"
Possible values: "720p", "1080p"
{
"model": "kwaivgi/kling-video/v4/image-to-video",
"image": "https://v3b.fal.media/files/b/rabbit/NaslJIC7F2WodS6DFZRRJ.png",
"prompt": "A detective in a black trench coat stands on a rooftop in the rain, looking through a telescope at the street below.",
"duration": 5,
"end_image": "https://v3b.fal.media/files/b/tiger/BwHi22qoQnqaTNMMhe533.png",
"resolution": "1080p"
}A completed run exposes its result in output. The following is the model’s saved example, not a new generation.
[
{
"url": "https://static.sandbase.ai/examples/746c1af3-e60b-4a50-a599-53df4d3da1ae/output/f9326313-f618-476e-bc14-075875ae2ed8.mp4"
}
]