imagesarrayobbligatorio
1-10 reference images (JPG/PNG, up to 30 MB, min 300 px, aspect ratio 2:5-5:2), referenced as @Image1, @Image2, ...
kwaivgi/kling-image/v4/editKling Image V4 Edit by Kuaishou edits or recomposes 1 to 10 reference images from a text instruction at native 2K, 4K or 8K resolution.
Prova il modello
PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 10
Seleziona un esempio per caricare i suoi input e il risultato nel playground.
{
"aspect_ratio": "16:9",
"images": [
"https://static.sandbase.ai/examples/af741566-8852-406d-be61-8044f265442c/input/ceb31edd-5be2-40d9-a2fa-7be80bf0160b.png"
],
"prompt": "Place the sneaker from @Image1 on a mossy rock beside a mountain stream at dawn, soft mist, keep the shoe design, colours and the KITO heel tab exactly."
}{
"aspect_ratio": "16:9",
"images": [
"https://static.sandbase.ai/examples/2cfc80be-f125-4f18-8644-bedf004feb6a/input/5bcf3e54-96c8-4a0f-9e71-46b534bf8821.png",
"https://static.sandbase.ai/examples/2cfc80be-f125-4f18-8644-bedf004feb6a/input/0ff16182-a90d-475f-b0c5-f88b3a1c7dc0.png"
],
"prompt": "Create a luxury magazine advertisement: the watch dial from @Image1 fitted with the strap from @Image2, lying on black velvet, headline \"AUREL — Time, Enamelled\" in elegant serif type."
}Kling Image V4 Edit edits or recomposes 1–10 reference images from a text instruction, at native 2K, 4K or 8K.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Refer to inputs as @Image1, @Image2, … |
images | image URL[], required | — | 1–10 images (JPG/PNG, up to 30 MB, at least 300 px per side, aspect ratio 2:5–5:2). |
aspect_ratio | auto / 16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 3:2 / 2:3 / 21:9 | auto | auto picks a shape from the prompt and references. |
resolution | 2K / 4K / 8K | 2K | Native output resolution. |
num_images | 1–9 | 1 | Independent images, each billed. |
Per output image by resolution, plus $0.003 per reference image.
| Request | Price |
|---|---|
| 1 reference, 2K (default) | $0.066 |
| 3 references, 4K | $0.103 |
| 1 reference, 8K | $0.160 |
| Failed runs are not charged. |
Other Kling Image V4 endpoints: kwaivgi/kling-image/v4, kwaivgi/kling-image/v4/edit, kwaivgi/kling-image/v4/long-image.
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-image/v4/edit",
"prompt": "Turn the scene in @Image1 into a snowy winter evening with warm window light, keep the composition.",
"num_images": 1,
"resolution": "2K",
"aspect_ratio": "auto"
}
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.
imagesarrayobbligatorio1-10 reference images (JPG/PNG, up to 30 MB, min 300 px, aspect ratio 2:5-5:2), referenced as @Image1, @Image2, ...
promptstringobbligatorioDescribe the image. Refer to reference images as @Image1, @Image2, ...
num_imagesintegerNumber of independent images to generate (1-9).
Predefinito: 1
Minimo: 1
Massimo: 9
resolutionstringOutput resolution. 8K is native ultra-high resolution.
Predefinito: "2K"
Valori possibili: "2K", "4K", "8K"
aspect_ratiostringOutput frame shape. auto picks one from the prompt and references.
Predefinito: "auto"
Valori possibili: "auto", "16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "21:9"
{
"model": "kwaivgi/kling-image/v4/edit",
"prompt": "Turn the scene in @Image1 into a snowy winter evening with warm window light, keep the composition.",
"num_images": 1,
"resolution": "2K",
"aspect_ratio": "auto"
}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/af741566-8852-406d-be61-8044f265442c/output/b778d304-ecaa-4f46-b016-a6a435c5a075.png"
}
]