Verwenden Sie die Kling Image Expansion API über CometAPI, um Bilder über ihre ursprünglichen Ränder hinaus zu erweitern und dabei den Kontext mit steuerbarer Füllung für videofähige Assets zu bewahren.
curl --request POST \
--url https://api.cometapi.com/kling/v1/images/editing/expand \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "https://cdn.britannica.com/70/234870-050-D4D024BB/Orange-colored-cat-yawns-displaying-teeth.jpg",
"up_expansion_ratio": 0.1,
"right_expansion_ratio": 0.1,
"left_expansion_ratio": 0.1,
"bottom_expansion_ratio": 0.1
}
'{
"code": 123,
"message": "<string>",
"data": {
"task_id": "<string>",
"task_status": "<string>",
"created_at": 123,
"updated_at": 123
},
"request_id": "<string>"
}0.1 auf jeder Seite, bevor Sie größere Erweiterungen versuchenPOST /kling/v1/images/editing/expand{"code": null, "message": "404"} für eine minimale AnfrageBearer token authentication. Use your CometAPI key.
Optional content type header.
Source image to expand. Accepts an image URL or raw Base64 string (no data: prefix). Supported formats: JPG, JPEG, PNG. Max 10 MB, minimum 300×300 px, aspect ratio between 1:2.5 and 2.5:1.
Upward expansion as a multiple of the original image height. Range: 0–2. The resulting image area must not exceed 3× the original.
Rightward expansion as a multiple of the original image width. Range: 0–2. The resulting image area must not exceed 3× the original.
Leftward expansion as a multiple of the original image width. Range: 0–2. The resulting image area must not exceed 3× the original.
Downward expansion as a multiple of the original image height. Range: 0–2. The resulting image area must not exceed 3× the original.
Optional text prompt to guide the expanded area content. Max 2500 characters.
Number of expanded images to generate.
Webhook URL for task status notifications. The server sends a callback when the task status changes.
Optional user-defined task ID for your own tracking. Does not replace the system-generated task ID. Must be unique per account.
Task accepted when the wrapper route is available.
curl --request POST \
--url https://api.cometapi.com/kling/v1/images/editing/expand \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "https://cdn.britannica.com/70/234870-050-D4D024BB/Orange-colored-cat-yawns-displaying-teeth.jpg",
"up_expansion_ratio": 0.1,
"right_expansion_ratio": 0.1,
"left_expansion_ratio": 0.1,
"bottom_expansion_ratio": 0.1
}
'{
"code": 123,
"message": "<string>",
"data": {
"task_id": "<string>",
"task_status": "<string>",
"created_at": 123,
"updated_at": 123
},
"request_id": "<string>"
}