Kling으로 이미지 확장하기
CometAPI를 통해 Kling Image Expansion API를 사용하여 원본 경계를 넘어 이미지를 확장하고 제어 가능한 아웃페인팅을 수행합니다.
확장 비율의 작동 방식
- 각 비율은 원본 너비 또는 높이를 기준으로 측정됩니다
- 확장된 전체 캔버스는 여전히 Kling 문서에 명시된 면적 제한 내에 있어야 합니다
- 더 큰 확장을 시도하기 전에 각 면에서
0.1과 같은 작은 값으로 시작하세요
요청 흐름
- 네 개의 ratio 필드를 모두 전송하고, 확장하지 않으려는 면에는
0을 사용하세요 - 반환된
task_id를 저장하세요 - 작업이 종료 상태에 도달할 때까지 해당하는 Kling 이미지 조회 경로를 폴링하세요
인증
Bearer token authentication. Use your CometAPI key.
헤더
Must be application/json.
본문
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.
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 <= 2Downward 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 <= 2Leftward 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 <= 2Rightward 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 <= 2Optional text prompt to guide the expanded area content. Maximum 2500 characters.
Number of expanded images to generate. Range: 1-9.
1 <= x <= 9Watermark options.
Webhook URL for task status notifications.
Optional user-defined task ID for your own tracking. Must be unique per account.