Docs / image / Grok Imagine Image 2.0 Image Edit
Grok Imagine Image 2.0 Image Edit online
Edit an existing image with Grok Imagine 2.0 — swap backgrounds, replace text, and restyle with a prompt.
Rp Rp320 / gambar
grok-imagine-image-2-0/image-edit model id
1 · Create a task
Kirim permintaan untuk membuat tugas generasi image. Wajib header Idempotency-Key. Saldo direservasi sebesar estimasi; task gagal tidak ditagih.
curl -X POST https://getrun.id/v1/tasks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: my-task-001" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-image-2-0/image-edit",
"input": {
"prompt": "Replace the main title “NOVA CREATIVE CLUB” with “Kie.ai Creative Studio” while preserving the original typography style, layout structure, and vintage editorial design language. Adapt the surrounding text elements to match the new Kie.ai Creative Studio identity while keeping the same visual hierarchy, spacing, and print texture. Maintain the original composition, including the portrait, color palette, curved graphic elements, badges, feature sections, and footer details. Make the new brand name appear naturally printed on the magazine cover with realistic distressed ink, consistent typography weight, and authentic editorial magazine quality. Keep the overall retro creative studio aesthetic unchanged, creating the feeling of a real Kie.ai Creative Studio special edition magazine.",
"image_urls": [
"https://example.com/input.jpg"
],
"aspect_ratio": "auto"
}
}'const res = await fetch('https://getrun.id/v1/tasks', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Idempotency-Key': 'my-task-001',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"model": "grok-imagine-image-2-0/image-edit",
"input": {
"prompt": "Replace the main title “NOVA CREATIVE CLUB” with “Kie.ai Creative Studio” while preserving the original typography style, layout structure, and vintage editorial design language. Adapt the surrounding text elements to match the new Kie.ai Creative Studio identity while keeping the same visual hierarchy, spacing, and print texture. Maintain the original composition, including the portrait, color palette, curved graphic elements, badges, feature sections, and footer details. Make the new brand name appear naturally printed on the magazine cover with realistic distressed ink, consistent typography weight, and authentic editorial magazine quality. Keep the overall retro creative studio aesthetic unchanged, creating the feeling of a real Kie.ai Creative Studio special edition magazine.",
"image_urls": [
"https://example.com/input.jpg"
],
"aspect_ratio": "auto"
}
}),
});
const task = await res.json();import requests
res = requests.post(
"https://getrun.id/v1/tasks",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Idempotency-Key": "my-task-001",
},
json={
"model": "grok-imagine-image-2-0/image-edit",
"input": {
"prompt": "Replace the main title “NOVA CREATIVE CLUB” with “Kie.ai Creative Studio” while preserving the original typography style, layout structure, and vintage editorial design language. Adapt the surrounding text elements to match the new Kie.ai Creative Studio identity while keeping the same visual hierarchy, spacing, and print texture. Maintain the original composition, including the portrait, color palette, curved graphic elements, badges, feature sections, and footer details. Make the new brand name appear naturally printed on the magazine cover with realistic distressed ink, consistent typography weight, and authentic editorial magazine quality. Keep the overall retro creative studio aesthetic unchanged, creating the feeling of a real Kie.ai Creative Studio special edition magazine.",
"image_urls": [
"https://example.com/input.jpg"
],
"aspect_ratio": "auto"
}
},
)
task = res.json()Input parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
prompt |
string | No | Text prompt describing the desired image. (max 5000 chars) | Replace the main title “NOVA CREATIVE CLUB” wi |
image_urls |
array | Yes | Upload an image file to use as input for the API (array of file URLs) | https://example.com/input.jpg |
aspect_ratio |
string | Yes | Specifies the width-to-height ratio of the generated image. Controls the aspect ratio of the output. Opsi: 1:1 2:3 3:2 16:9 9:16 auto |
auto |
2 · Poll the result
Ambil status tugas hingga selesai — poll tiap 2–5 detik.
Respons saat sukses:
{
"id": "task_9f2c…",
"status": "succeeded",
"model": "grok-imagine-image-2-0/image-edit",
"price": {
"currency": "IDR",
"estimated": 320,
"reserved": 320,
"final": 320
},
"output": {
"urls": [
"https://storage.getcore.id/outputs/task_9f2c…/0.png"
],
"expires_at": "(7 hari setelah selesai)"
}
}
Status values
| Status | Keterangan |
|---|---|
queued | Tugas sedang diantrikan. |
processing | Sedang diproses. |
succeeded | Berhasil. |
failed | Gagal — lihat error detail, tidak ditagih. |
image/png, dilayani dari CDN kami dan berlaku 7 hari — salin ke penyimpananmu sendiri untuk jangka panjang.Best practices
Bila generation gagal, task berstatus failed dengan error.code ternormalisasi (mis. moderation_blocked, upstream_error) dan price.final = 0 — saldo dikembalikan otomatis. Daftar lengkap kode error ada di Error handling. Selalu kirim Idempotency-Key unik per tugas agar retry aman.
Coba tanpa kode: jalankan model ini langsung dari Playground atau lihat di API Market.
