imagesarray
List of URLs of the images to edit. A maximum of 3 images are supported.
xai/grok-imagine-image/quality/editGrok Imagine Image Quality Edit is xAI's intelligent image editing model. Transform, retouch, and reimagine existing images using text prompts - from background replacement to artistic style conversion.
Modeli deneyin
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
Bir örnek seçerek girdilerini ve sonucunu playground'a yükleyin.
{
"prompt": "Make this scene more realistic but still keep the game vibes"
}İnsan tercihi
Kör yan yana oylamalardan elde edilen Elo puanları, diğer görsel ve video modelleriyle karşılaştırılır.
Sıralamalar Artificial Analysis Arena kaynaklıdır
Görsel düzenleme arena: kullanıcılar, model adlarını görmeden aynı görsel ve yönergeden yapılan iki düzenlemeden daha iyisini seçer.
Grok Imagine Image (Quality) edit: change or combine images with an instruction.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 8,000 characters. |
images | image URL[] | — | Images to edit or combine, Image 1, Image 2, … |
resolution | 1k / 2k | 1k | Sets the per-image rate. |
aspect_ratio | 21:9 / 16:9 / 3:2 / 4:3 / 5:4 / 1:1 / 4:5 / 3:4 / 2:3 / 9:16 | — | Output shape. |
$0.05 per output image at 1K and $0.07 at 2K, plus $0.01 per input image.
| Request | 1k | 2k |
|---|---|---|
| 1 input image | $0.06 | $0.08 |
| 3 input images | $0.08 | $0.10 |
Failed runs are not charged.
Other Grok Imagine Image endpoints: xai/grok-imagine-image/quality, xai/grok-imagine-image/edit, xai/grok-imagine-image/2.0/text-to-image, xai/grok-imagine-image/2.0/edit.
Geliştirmeye başlayın
Bu modeli SandBase Unified Run API üzerinden gönderin.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "xai/grok-imagine-image/quality/edit",
"images": [
"https://static.sandbase.ai/examples/xai/grok-imagine-image/quality/edit/input_images_0.png"
],
"prompt": "Make this scene more realistic but still keep the game vibes",
"resolution": "1k"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Bir SandBase API anahtarı oluşturun ve sunucu ortamınıza ayarlayın. Tüm istekler Bearer kimlik doğrulaması kullanır.
export SANDBASE_API_KEY="YOUR_API_KEY"Anahtarı sunucuda tutun. Tarayıcı kodunda açığa çıkarmayın veya bir depoya commit etmeyin.
Bu model kimliği ve girdileriyle /v1/run adresine POST gönderin. Yukarıdaki istek örneği gönderme ve yoklamayı içerir.
Durum completed, failed veya timeout olana kadar verilen run ID ile yoklama yapın. Çıktıyı yalnızca completed olduktan sonra okuyun.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Modelin image, video veya audio alanına herkese açık erişilebilir bir dosya URL'si verin. Desteklenen formatlar ve sınırlar her Playground girişinin yanında gösterilir.
Playground'daki desteklenen image alanlarında yükleme veya değiştirme kontrolünü kullanın. Video URL alanları barındırılan bir sürüş videosu kabul eder; video yükleme desteği anlamına gelmez.
imagesarrayList of URLs of the images to edit. A maximum of 3 images are supported.
promptstringzorunluText description of the desired image.
resolutionstringResolution of the generated image. `1k` for standard resolution, `2k` for high resolution.
Varsayılan: "1k"
Olası değerler: "1k", "2k"
aspect_ratiostringThe aspect ratio of the generated image.
Olası değerler: "21:9", "16:9", "3:2", "4:3", "5:4", "1:1", "4:5", "3:4", "2:3", "9:16"
{
"model": "xai/grok-imagine-image/quality/edit",
"images": [
"https://static.sandbase.ai/examples/xai/grok-imagine-image/quality/edit/input_images_0.png"
],
"prompt": "Make this scene more realistic but still keep the game vibes",
"resolution": "1k"
}Tamamlanan bir run, sonucunu output içinde gösterir. Aşağıdaki, modelin kaydedilmiş örneğidir; yeni bir üretim değildir.
[
{
"source": "xAI schema mirror",
"source_url": "https://docs.x.ai/",
"url": "https://static.sandbase.ai/examples/82afda34-7fa3-4649-a939-41914f92c6a8/output/7686883d-70d4-4a65-a1bd-e38f05ff34fc.jpg"
}
]