curl --request POST \
--url https://api.modellix.ai/api/v1/kling/kling-image-expansion \
--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": "model-123",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-expansion-xyz789"
}
}
}{
"code": 400,
"message": "Invalid parameters: parameter 'image' is required"
}{
"code": 401,
"message": "Authentication failed: invalid API key"
}{
"code": 429,
"message": "Rate limit exceeded: 100 requests per minute, retry after 60 seconds"
}{
"code": 500,
"message": "Internal server error"
}Kling Image Expansion
[Core Function] Kling Image Expansion is an outpainting model. [Strengths] It intelligently extends the borders of an image (horizontal, vertical, or asymmetric) while matching the original style and context. [Best For] Highly recommended for: changing aspect ratios, extending landscapes, and filling out cropped photos. [Limitations] Do NOT use this model for inpainting or style transfer. [Routing] Use this specifically when the user asks to ‘expand’, ‘extend’, or ‘uncrop’ an image.
curl --request POST \
--url https://api.modellix.ai/api/v1/kling/kling-image-expansion \
--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": "model-123",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-expansion-xyz789"
}
}
}{
"code": 400,
"message": "Invalid parameters: parameter 'image' is required"
}{
"code": 401,
"message": "Authentication failed: invalid API key"
}{
"code": 429,
"message": "Rate limit exceeded: 100 requests per minute, retry after 60 seconds"
}{
"code": 500,
"message": "Internal server error"
}Authorizations
API Key authentication. Format: Bearer YOUR_API_KEY.
Body
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.
Original image (URL or Base64 encoded, do not include 'data:' prefix for Base64). Supported formats: .jpg, .jpeg, .png. Maximum size: 10MB. Minimum dimensions: 300x300px
1"https://example.com/original.jpg"
Upward expansion ratio, based on original image height. Range: 0.0-2.0
0 <= x <= 20.5
Downward expansion ratio, based on original image height. Range: 0.0-2.0
0 <= x <= 20.5
Leftward expansion ratio, based on original image width. Range: 0.0-2.0
0 <= x <= 20.5
Rightward expansion ratio, based on original image width. Range: 0.0-2.0
0 <= x <= 20.5
Positive prompt to guide content generation in expanded areas
2500"Extend with natural landscape elements"
Number of images to generate per request
1 <= x <= 91