Skip to main content
POST
/
kling-image-expansion
/
async
curl --request POST \
  --url https://api.modellix.ai/api/v1/image-to-image/kling/kling-image-expansion/async \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "image": "https://example.com/city-center.jpg",
  "up_expansion_ratio": 0,
  "down_expansion_ratio": 0,
  "left_expansion_ratio": 1,
  "right_expansion_ratio": 1
}
'
{
  "code": 0,
  "message": "success",
  "data": {
    "status": "pending",
    "task_id": "task-expansion-xyz789",
    "model_id": "kling-image-expansion"
  }
}

Authorizations

Authorization
string
header
required

API Key authentication. Format: Bearer YOUR_API_KEY.

Body

application/json

Note: All four expansion ratio parameters are required. Set to 0.0 for directions that do not need expansion. This model does NOT support: negative_prompt, aspect_ratio, resolution, image_fidelity, image_reference, or human_fidelity parameters.

image
string
required

Original image (URL or Base64 encoded, do not include 'data:' prefix for Base64). Supported formats: .jpg, .jpeg, .png. Maximum size: 10MB. Minimum dimensions: 300x300px

Minimum string length: 1
Example:

"https://example.com/original.jpg"

up_expansion_ratio
number<float>
required

Upward expansion ratio, based on original image height. Range: 0.0-2.0

Required range: 0 <= x <= 2
Example:

0.5

down_expansion_ratio
number<float>
required

Downward expansion ratio, based on original image height. Range: 0.0-2.0

Required range: 0 <= x <= 2
Example:

0.5

left_expansion_ratio
number<float>
required

Leftward expansion ratio, based on original image width. Range: 0.0-2.0

Required range: 0 <= x <= 2
Example:

0.5

right_expansion_ratio
number<float>
required

Rightward expansion ratio, based on original image width. Range: 0.0-2.0

Required range: 0 <= x <= 2
Example:

0.5

prompt
string

Positive prompt to guide content generation in expanded areas

Maximum string length: 2500
Example:

"Extend with natural landscape elements"

n
integer
default:1

Number of images to generate per request

Required range: 1 <= x <= 9
Example:

1

Response

Task submitted successfully

code
integer
required

Response code, 0 indicates success

Example:

0

message
string
required

Response message

Example:

"success"

data
object
required