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

확장 비율의 작동 방식

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

요청 흐름

  • 네 개의 ratio 필드를 모두 전송하고, 확장하지 않으려는 면에는 0을 사용하세요
  • 반환된 task_id를 저장하세요
  • 작업이 종료 상태에 도달할 때까지 해당하는 Kling 이미지 조회 경로를 폴링하세요
전체 파라미터 참조는 공식 Kling 문서를 참고하세요.

인증

Authorization
string
header
필수

Bearer token authentication. Use your CometAPI key.

헤더

Content-Type
string
기본값:application/json

Must be application/json.

본문

application/json
image
string
필수

Source image to expand. Image URL or raw Base64 string without a data: prefix. Supported formats: JPG, JPEG, PNG. Maximum 10 MB, minimum 300x300 px, aspect ratio between 1:2.5 and 2.5:1.

up_expansion_ratio
number
필수

Upward expansion ratio as a multiple of the original image dimension. Range: 0-2. Send 0 for sides you do not want to expand.

필수 범위: 0 <= x <= 2
down_expansion_ratio
number
필수

Downward expansion ratio as a multiple of the original image dimension. Range: 0-2. Send 0 for sides you do not want to expand.

필수 범위: 0 <= x <= 2
left_expansion_ratio
number
필수

Leftward expansion ratio as a multiple of the original image dimension. Range: 0-2. Send 0 for sides you do not want to expand.

필수 범위: 0 <= x <= 2
right_expansion_ratio
number
필수

Rightward expansion ratio as a multiple of the original image dimension. Range: 0-2. Send 0 for sides you do not want to expand.

필수 범위: 0 <= x <= 2
prompt
string

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

n
integer
기본값:1

Number of expanded images to generate. Range: 1-9.

필수 범위: 1 <= x <= 9
watermark_info
object

Watermark options.

callback_url
string

Webhook URL for task status notifications.

external_task_id
string

Optional user-defined task ID for your own tracking. Must be unique per account.

응답

200 - application/json

Task request accepted or an error response returned by the API.

code
필수

Response code. 0 means the task request was accepted.

message
string
필수

Response message.

data
object
필수
request_id
string

Request identifier returned when present.