imagesarrayrequired
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.
Try the model
PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 10
Select an example to load its inputs and result into the 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.00315 per reference image.
| Request | Price |
|---|---|
| 1 reference, 2K (default) | $0.06615 |
| 3 references, 4K | $0.10395 |
| 1 reference, 8K | $0.16065 |
| 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.
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-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"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.
imagesarrayrequired1-10 reference images (JPG/PNG, up to 30 MB, min 300 px, aspect ratio 2:5-5:2), referenced as @Image1, @Image2, ...
promptstringrequiredDescribe the image. Refer to reference images as @Image1, @Image2, ...
num_imagesintegerNumber of independent images to generate (1-9).
Default: 1
Minimum: 1
Maximum: 9
resolutionstringOutput resolution. 8K is native ultra-high resolution.
Default: "2K"
Possible values: "2K", "4K", "8K"
aspect_ratiostringOutput frame shape. auto picks one from the prompt and references.
Default: "auto"
Possible values: "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"
}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/af741566-8852-406d-be61-8044f265442c/output/b778d304-ecaa-4f46-b016-a6a435c5a075.png"
}
]