videostringobrigatório
Video to edit (3-30s, min 700x700 px, up to 300 MB). The output keeps its length.
kwaivgi/kling-video/v4/video-editKling V4 Video Edit by Kuaishou edits a 3-30 second source video from a text instruction and optional reference images.
Testar o modelo
PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 10
O que você gostaria de fazer em seguida?
Selecione um exemplo para carregar as entradas e o resultado no playground.
{
"prompt": "Change the time of day in @Video1 to a starry night with the boat glowing softly, keep the camera motion.",
"video": "https://static.sandbase.ai/examples/c5782511-455d-4642-aed4-aee4d9a68521/input/cc801f7f-f034-4822-99db-04c72e2b9743.mp4"
}{
"prompt": "Restyle @Video1 as a hand-drawn watercolor animation, keep the vendor's motion and the flames.",
"video": "https://static.sandbase.ai/examples/8bd56a37-82da-4689-bfeb-b3d6e6db43dd/input/0ff13888-7225-4b82-bbe3-0ddbcabe39d0.mp4"
}Kling V4 video edit changes a 3–30 second source video from a text instruction, with optional reference images. The output keeps the source length.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Edit instruction. Refer to the source as @Video1 and images as @Image1, … |
video | video URL, required | — | 3–30s, min 700×700 px, up to 300 MB. |
images | image URL[] | — | Up to 10 reference images. |
resolution | 720p / 1080p / 4k | 1080p | Output resolution. |
dynamic_range | sdr / hdr | sdr | hdr outputs 10-bit HDR video. 1080p and 4k only. |
$0.094 (720p), $0.141 (1080p) or $0.329 (4K) per second, counted on input plus output (2× the source length). Settlement uses the output length (it matches the source); the quote before submission assumes a 30 second source when the length cannot be read. HDR adds $0.047 per output second at 1080p and $0.078 at 4K.
| Source | Price |
|---|---|
| 6s, 1080p | $1.692 |
| 10s, 720p | $1.88 |
| 10s, 4K | $6.58 |
| 10s, 4K, HDR | $7.36 |
| 30s, 1080p | $8.46 |
| 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.
Comece a construir
Envie este modelo pela 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/video-edit",
"prompt": "Change the background to a tropical island at sunset.",
"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"Crie uma chave da API SandBase e defina-a no ambiente do seu servidor. Todas as requisições usam autenticação Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Mantenha a chave no servidor. Não a exponha em código do navegador nem a comite em um repositório.
Faça POST para /v1/run com este ID de modelo e suas entradas. O exemplo de requisição acima inclui envio e polling.
Use o ID de execução retornado para fazer polling até que o status seja completed, failed ou timeout. Leia a saída somente após completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Passe uma URL de arquivo acessível publicamente no campo de imagem, vídeo ou áudio do modelo. Os formatos e limites suportados são mostrados ao lado de cada entrada do Playground.
Use o controle de upload ou substituição nos campos de imagem suportados no Playground. Campos de URL de vídeo aceitam um vídeo de condução hospedado; isso não implica suporte a upload de vídeo.
videostringobrigatórioVideo to edit (3-30s, min 700x700 px, up to 300 MB). The output keeps its length.
imagesarrayOptional reference images, referenced as @Image1, @Image2, ...
promptstringobrigatórioEdit instruction. Refer to the source video as @Video1 and reference images as @Image1, @Image2, ...
resolutionstringOutput resolution.
Padrão: "1080p"
Valores possíveis: "720p", "1080p", "4k"
dynamic_rangestringhdr outputs 10-bit HDR video; 1080p and 4k only.
Padrão: "sdr"
Valores possíveis: "sdr", "hdr"
{
"model": "kwaivgi/kling-video/v4/video-edit",
"prompt": "Change the background to a tropical island at sunset.",
"resolution": "1080p",
"dynamic_range": "sdr"
}Uma execução concluída expõe seu resultado em output. O texto a seguir é o exemplo salvo do modelo, não uma nova geração.
[
{
"url": "https://static.sandbase.ai/examples/c5782511-455d-4642-aed4-aee4d9a68521/output/e7edbd9a-0c29-4b45-8e1d-701fba8ef596.mp4"
}
]