imagestringerforderlich
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.
Modell testen
PNG, JPEG, WebP oder GIF · maximal 20 MiB
PNG, JPEG, WebP oder GIF · maximal 20 MiB
Was möchten Sie als Nächstes tun?
Wählen Sie ein Beispiel aus, um seine Eingaben und das Ergebnis in den Playground zu laden.
{
"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 / 4k | 1080p | Output resolution. |
dynamic_range | sdr / hdr | sdr | hdr outputs 10-bit HDR video. 1080p and 4k only. |
duration | 3–30 | 5 | Output length in seconds. |
Billed per output second: $0.157 at 720p, $0.235 at 1080p, $0.549 at 4K. HDR adds $0.047 per output second at 1080p and $0.078 at 4K.
| Output | Price |
|---|---|
| 5s, 1080p (default) | $1.175 |
| 5s, 720p | $0.785 |
| 5s, 4K | $2.745 |
| 5s, 4K, HDR | $3.135 |
| 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.
Jetzt loslegen
Senden Sie dieses Modell über die 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",
"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,
"resolution": "1080p",
"dynamic_range": "sdr"
}
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"Erstellen Sie einen SandBase API-Schlüssel und legen Sie ihn in Ihrer Serverumgebung fest. Alle Anfragen verwenden Bearer-Authentifizierung.
export SANDBASE_API_KEY="YOUR_API_KEY"Bewahren Sie den Schlüssel auf dem Server auf. Geben Sie ihn nicht in Browser-Code preis und committen Sie ihn nicht in ein Repository.
POST an /v1/run mit dieser Modell-ID und ihren Eingaben. Das obige Anfragebeispiel umfasst Übermittlung und Polling.
Verwenden Sie die zurückgegebene Run-ID zum Polling, bis der Status completed, failed oder timeout ist. Lesen Sie die Ausgabe erst nach completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Übergeben Sie eine öffentlich zugängliche Date-URL im Bild-, Video- oder Audiofeld des Modells. Unterstützte Formate und Limits werden neben jedem Playground-Eingabefeld angezeigt.
Verwenden Sie im Playground bei unterstützten Bildfeldern die Steuerung zum Hochladen oder Ersetzen. Video-URL-Felder akzeptieren ein gehostetes Fahrvideo; sie implizieren keine Unterstützung für Video-Uploads.
imagestringerforderlichFirst frame. Min 300x300 px, aspect ratio 0.4-2.5, up to 30 MB.
promptstringerforderlichDescribe subject, action, camera and light.
durationintegerOutput length in seconds (3-30).
Standard: 5
Minimum: 3
Maximum: 30
end_imagestringOptional last frame.
resolutionstringOutput resolution.
Standard: "1080p"
Mögliche Werte: "720p", "1080p", "4k"
dynamic_rangestringhdr outputs 10-bit HDR video; 1080p and 4k only.
Standard: "sdr"
Mögliche Werte: "sdr", "hdr"
{
"model": "kwaivgi/kling-video/v4/image-to-video",
"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,
"resolution": "1080p",
"dynamic_range": "sdr"
}Ein abgeschlossener Run stellt sein Ergebnis in der Ausgabe bereit. Das Folgende ist das gespeicherte Beispiel des Modells, keine neue Generierung.
[
{
"url": "https://static.sandbase.ai/examples/746c1af3-e60b-4a50-a599-53df4d3da1ae/output/f9326313-f618-476e-bc14-075875ae2ed8.mp4"
}
]