Grok ile görseller oluşturun
Kalite, en boy oranı, çözünürlük, görsel sayısı ve response format denetimleri dâhil olmak üzere Grok Imagine Image 2.0 ile görseller oluşturun.
application/json kullanılır.
model ve prompt zorunludur.
Bir model seçin
Şuradan bir Grok image model ID seçin: Models sayfası. API örneklerindegrok-imagine-image-2.0 kullanılır.
quality yalnızca grok-imagine-image-2.0 ile kullanılabilir ve low ya da medium kabul eder. Uygulamanız belirli bir kalite düzeyine bağlıysa bunu açıkça ayarlayın. Image 2.0 için resolution atlandığında CometAPI, 1k kullanır.
Çıktıyı yapılandırın
- Çıktı şeklini seçmek için
aspect_ratiokullanın veya modelin şekli seçmesine izin vermek içinautokullanın. resolutionya da1kçıktısı istemek için2kkullanın.- 1 ile 10 arasında görsel istemek için
nkullanın. Varsayılan değer1şeklindedir. - Geçici URL’ler veya Base64 kodlu görsel verileri döndürmek için
response_formatkullanın.
b64_json kullanın.Yetkilendirmeler
Use your CometAPI API key as the bearer value.
Gövde
The Grok image model ID. See the Models page for available model IDs.
grok-imagine-image, grok-imagine-image-quality, grok-imagine-image-2.0 "grok-imagine-image-2.0"
A text description of the image to generate.
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. Image 2.0 uses 1k when this field is omitted.
1k, 2k "1k"
Image quality for grok-imagine-image-2.0. This field is not available for the older Grok image model IDs.
low, medium "low"
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