Skip to content

Outpainting

POST
/kling/v1/images/editing/expand

Expand the canvas around a reference image proportionally and generate the outpainted result.

Authorizations

bearer
Type
HTTP (bearer)

Request Body

application/json
object

Reference image.
Supports Base64-encoded image data or an image URL (must be accessible).

Upward expansion range, calculated as a multiple of the original image height.
Range: [0, 2]. The total area of the new image must not exceed 3× the original.
Example: original height 20, value 0.1 → distance from original top to new top = 20 × 0.1 = 2 (expansion zone).

Downward expansion range, calculated as a multiple of the original image height.
Range: [0, 2]. The total area of the new image must not exceed 3× the original.
Example: original height 20, value 0.2 → distance from original bottom to new bottom = 20 × 0.2 = 4 (expansion zone).

Leftward expansion range, calculated as a multiple of the original image width.
Range: [0, 2]. The total area of the new image must not exceed 3× the original.
Example: original width 30, value 0.3 → distance from original left to new left = 30 × 0.3 = 9 (expansion zone).

Rightward expansion range, calculated as a multiple of the original image width.
Range: [0, 2]. The total area of the new image must not exceed 3× the original.
Example: original width 30, value 0.4 → distance from original right to new right = 30 × 0.4 = 12 (expansion zone).

Positive text prompt.
Up to 2500 characters.

Number of images to generate.
Range: [1, 9].

Callback URL when the task completes

External task ID

Responses

OK

application/json
object

Task ID

Task status

Playground

Authorization
Body

Samples