메인 콘텐츠로 건너뛰기
POST
/
kling
/
v1
/
images
/
editing
/
expand
Request a Kling image-expansion task
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>"
}

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

원본 콘텐츠 주변에 더 넓은 캔버스가 필요할 때, 이 엔드포인트를 사용해 이미지의 원래 경계를 넘어 아웃페인팅할 수 있습니다.

확장 비율 작동 방식

  • 각 비율은 원본 너비 또는 높이를 기준으로 측정됩니다
  • 확장된 전체 캔버스는 여전히 Kling 문서에 명시된 면적 제한 내에 있어야 합니다
  • 더 큰 확장을 시도하기 전에 각 면에 0.1과 같은 작은 값부터 시작하세요

현재 사용 가능 여부

  • 문서화된 경로는 POST /kling/v1/images/editing/expand입니다
  • 이 엔드포인트는 404 응답을 반환합니다
이 경로를 프로덕션 플로우에 통합하기 전에 사용 가능 여부를 확인하세요.
전체 파라미터 참조는 공식 Kling 문서를 확인하세요.

인증

Authorization
string
header
필수

Bearer token authentication. Use your CometAPI key.

헤더

Content-Type
string

Optional content type header.

본문

application/json
image
string
기본값:https://cdn.britannica.com/70/234870-050-D4D024BB/Orange-colored-cat-yawns-displaying-teeth.jpg
필수

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.

up_expansion_ratio
number
기본값:1
필수

Upward expansion as a multiple of the original image height. Range: 0–2. The resulting image area must not exceed 3× the original.

right_expansion_ratio
number
기본값:1
필수

Rightward expansion as a multiple of the original image width. Range: 0–2. The resulting image area must not exceed 3× the original.

left_expansion_ratio
number
기본값:1
필수

Leftward expansion as a multiple of the original image width. Range: 0–2. The resulting image area must not exceed 3× the original.

bottom_expansion_ratio
number
기본값:1
필수

Downward expansion as a multiple of the original image height. Range: 0–2. The resulting image area must not exceed 3× the original.

prompt
string

Optional text prompt to guide the expanded area content. Max 2500 characters.

n
string

Number of expanded images to generate.

callback_url
string

Webhook URL for task status notifications. The server sends a callback when the task status changes.

external_task_id
string

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 route is available.

code
integer
필수

Error code; specifically define the error code

message
string
필수

error message

data
object
필수
request_id
string

Request ID, system-generated, for tracking requests, troubleshooting issues