Grok으로 이미지 편집
JSON 요청에서 이미지 URL 또는 data URI를 전송하여 Grok으로 하나 이상의 이미지를 편집하세요.
application/json을 사용합니다.
이미지 입력 제공
image또는images중 정확히 하나를 전송하세요.- 소스 이미지 하나에는
image을 사용하세요. - 소스 이미지가 두 개 또는 세 개인 경우
images을 사용하세요. - 각 이미지 객체에서 공개 URL 또는 data URI에는
url을 사용하세요.image_url은url의 호환성 별칭입니다. - 다중 이미지 편집의 출력 형태를 제어하려면
aspect_ratio을 사용하세요.
grok-imagine-image-quality을 사용합니다.
OpenAI SDK의 images.edit() 메서드는 멀티파트 폼 데이터를 전송합니다. Grok JSON 이미지 편집에는 직접 HTTP 요청을 사용하세요.
공급자 파라미터 세부정보는 xAI 이미지 편집 가이드를 참조하세요.인증
Use your CometAPI API key as the bearer value.
본문
- Option 1
- Option 2
The Grok image model ID. See the Models page for available model IDs.
grok-imagine-image, grok-imagine-image-quality "grok-imagine-image-quality"
A text instruction that describes the requested edit.
1"Replace the daytime sky with a soft sunset and preserve the building"
One source image. Use this field instead of images.
- Option 1
- Option 2
Two or three source images. Use this field instead of image.
2 - 3 elementsA source image represented by url or the compatibility alias image_url.
- Option 1
- Option 2
The number of edited images to generate. Use an integer from 1 through 10.
1 <= x <= 10The output shape for a multi-image edit.
1:1, 3:4, 4:3, 16:9, 2:3, 3:2, 9:19.5, 19.5:9, 9:20, 20:9, 1:2 "16:9"
The requested output resolution.
1k, 2k "1k"
The image representation in each response item. Use url for a temporary download URL or b64_json for Base64-encoded image bytes.
url, b64_json