Grok
Grok으로 이미지 생성
JSON 요청, 종횡비 제어, 해상도 제어, URL 또는 Base64 출력으로 Grok 이미지를 생성하세요.
POST
이 경로를 사용하여 Grok 이미지 모델로 텍스트에서 이미지를 생성합니다. 요청 본문에는
application/json을 사용합니다.
요청은 model, prompt, n, aspect_ratio, resolution 및 response_format을 지원합니다.
모델 선택
Grok 이미지 모델 ID는 모델 페이지에서 선택하세요. API 예시에서는grok-imagine-image-quality을 사용합니다.
출력 구성
- 출력 형상을 선택하려면
aspect_ratio을 사용하고, 모델이 형상을 선택하도록 하려면auto을 사용하세요. resolution을 사용하여1k또는2k출력을 요청하세요.n을 사용하여 최대 10개의 이미지를 요청하세요.response_format을 사용하여 임시 URL 또는 Base64로 인코딩된 이미지 데이터를 반환하세요.
요청이 완료된 후 URL 결과를 다운로드하세요. 생성된 이미지 URL은 만료될 수 있습니다.
인증
Use your CometAPI API key as the bearer value.
본문
application/json
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 description of the image to generate.
Minimum string length:
1예시:
"A glass observatory above a quiet alpine lake at sunrise"
The number of images to generate. Use an integer from 1 through 10.
필수 범위:
1 <= x <= 10The output shape. Use auto to let the model select the aspect ratio.
사용 가능한 옵션:
1:1, 3:4, 4:3, 9:16, 16:9, 2:3, 3:2, 9:19.5, 19.5:9, 9:20, 20:9, 1:2, 2:1, auto 예시:
"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