imagestringobbligatorio
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.
Prova il modello
PNG, JPEG, WebP o GIF · massimo 20 MiB
PNG, JPEG, WebP o GIF · massimo 20 MiB
Cosa vuoi fare dopo?
Seleziona un esempio per caricare i suoi input e il risultato nel 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 / 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.
Inizia a costruire
Invia questo modello tramite la 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"Crea una SandBase API key e impostala nell'ambiente del server. Tutte le richieste usano l'autenticazione Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserva la key sul server. Non esporla nel codice del browser né committarla in un repository.
Esegui POST su /v1/run con questo ID modello e i relativi input. L'esempio di richiesta sopra include invio e polling.
Usa il run ID restituito per fare polling finché lo stato non è completed, failed o timeout. Leggi l'output solo dopo completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Passa un URL di file accessibile pubblicamente nel campo image, video o audio del modello. I formati supportati e i limiti sono mostrati accanto a ciascun input del Playground.
Usa il controllo upload o replace sui campi immagine supportati nel Playground. I campi URL video accettano un video di driving ospitato; non implicano il supporto al caricamento video.
imagestringobbligatorioFirst frame. Min 300x300 px, aspect ratio 0.4-2.5, up to 30 MB.
promptstringobbligatorioDescribe subject, action, camera and light.
durationintegerOutput length in seconds (3-30).
Predefinito: 5
Minimo: 3
Massimo: 30
end_imagestringOptional last frame.
resolutionstringOutput resolution.
Predefinito: "1080p"
Valori possibili: "720p", "1080p", "4k"
dynamic_rangestringhdr outputs 10-bit HDR video; 1080p and 4k only.
Predefinito: "sdr"
Valori possibili: "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"
}Un run completato espone il risultato in output. Quanto segue è l'esempio salvato del modello, non una nuova generazione.
[
{
"url": "https://static.sandbase.ai/examples/746c1af3-e60b-4a50-a599-53df4d3da1ae/output/f9326313-f618-476e-bc14-075875ae2ed8.mp4"
}
]