
Text-to-image plus multi-reference editing with up to three source images, selectable quality tiers, and 1K or 2K output resolution.
Text-to-image plus multi-reference editing with up to three source images, selectable quality tiers, and 1K or 2K output resolution.
इस नाम से भी जाना जाता है Grok Imagine Image, xAI Grok Imagine Image 2.0
grok-imagine-image-2-0/v1/images/generationsPOST/v1/images/editsgrok-imagine-image-2grok-imagine-image-2.0xai/grok-imagine-image-2-0xai/grok-imagine-image-2xai/grok-imagine-image-2.0EmpirioLabs कैटलॉग से लाइव pay-as-you-go दरें। आप सिर्फ उतना ही भुगतान करते हैं जितना उपयोग करते हैं, कोई मासिक न्यूनतम नहीं।
Grok Imagine Image 2.0 POST /v1/images/generations से चलता है। request तुरंत job_id देती है; job पूरा होने तक GET /v1/jobs/{job_id} को poll करें और परिणाम से आउटपुट URLs पढ़ें। या polling छोड़ने के लिए "sync": true जोड़ें: request खुली रहती है और सीधे OpenAI-शैली की पूरी इमेज प्रतिक्रिया देती है, इसलिए OpenAI SDKs वैसे ही काम करते हैं। EmpirioLabs डैशबोर्ड से API key प्राप्त करें।
curl https://api.empiriolabs.ai/v1/images/generations \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-image-2-0",
"prompt": "Describe what you want Grok Imagine Image 2.0 to generate."
}'curl https://api.empiriolabs.ai/v1/jobs/JOB_ID \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY"import requests
response = requests.post(
"https://api.empiriolabs.ai/v1/images/generations",
headers={"Authorization": "Bearer YOUR_EMPIRIOLABS_API_KEY"},
json={
"model": "grok-imagine-image-2-0",
"prompt": "Describe what you want Grok Imagine Image 2.0 to generate.",
},
)
job = response.json()
# Generation runs as an async job. Poll until it completes.
import time
while True:
status = requests.get(
f"https://api.empiriolabs.ai/v1/jobs/{job['job_id']}",
headers={"Authorization": "Bearer YOUR_EMPIRIOLABS_API_KEY"},
).json()
if status.get("status") in ("completed", "failed"):
print(status)
break
time.sleep(5)EmpirioLabs पर Grok Imagine Image 2.0 API द्वारा समर्थित request पैरामीटर। फ़ील्ड छोड़ने पर डिफ़ॉल्ट मान लागू होते हैं।
| पैरामीटर | प्रकार | डिफॉल्ट | रेंज / मान | विवरण |
|---|---|---|---|---|
| prompt | string | - | - | Describe the image to create. With source images attached, this becomes the editing instruction. Refer to multiple images as <IMAGE_0>, <IMAGE_1>, and so on. Up to... |
| image | array | - | - | One to three source images to edit, as URLs, data URIs, or uploaded image objects. Leave empty to generate from the prompt alone. |
| images | array | - | - | Plural alias for multiple uploaded image references. |
| quality | enum | medium | low, medium | Rendering quality. Low returns in a few seconds and costs less per image. Medium takes longer and resolves finer detail. |
| resolution | enum | 1k | 1k, 2k | Output resolution tier. 2k renders more pixels and costs more per image than 1k. |
| aspect_ratio | enum | auto | auto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 19.5:9, ... | Output aspect ratio. Auto lets the model pick the best fit for the prompt. For an edit, auto follows the first source image. |
| num_images | number | 1 | 1 से 10 | Number of output images. Each output image is billed separately. |
| response_format | enum | url | url, b64_json | Return signed image URLs by default, or include base64 image data when b64_json is requested. |
Generates images from a text prompt, or edits up to three source images from a natural-language instruction.
Place the product from <IMAGE_0> onto the marble surface in <IMAGE_1>.Quality selects how much work goes into the render: low returns in a few seconds, medium takes longer and resolves finer detail. Resolution selects the 1K or 2K output tier. The two combine into four price points, so a low 1K image is the cheapest option and a medium 2K image the most detailed.
Supports prompt, source images (URL or upload), quality, resolution, aspect ratio across fourteen ratios including auto, number of images, and response format.
Generated images pass an automated content-safety check. An image flagged as explicit is not returned. Because the image is generated before the check runs, a flagged generation is still billed.
EmpirioLabs पर Grok Imagine Image 2.0 का बिल उपयोग के अनुसार बनता है: Low quality, 1K $0.048 per image; Low quality, 2K $0.072 per image; Medium quality, 1K $0.072 per image। इस पेज की लाइव दर तालिका हमेशा API की वास्तविक बिलिंग से मेल खाती है।
Grok Imagine Image 2.0 api.empiriolabs.ai पर POST /v1/images/generations के ज़रिए मिलता है, मानक Bearer टोकन प्रमाणीकरण के साथ।
हां। EmpirioLabs playground ब्राउज़र में Grok Imagine Image 2.0 को उन्हीं पैरामीटरों के साथ चलाता है जो API देता है, ताकि आप कोड लिखने से पहले prompt आज़मा सकें।
EmpirioLabs खाता बनाएं, फिर डैशबोर्ड में API Keys में key जनरेट करें। बिलिंग pay-as-you-go क्रेडिट से होती है, इसलिए आप सिर्फ अपनी requests का भुगतान करते हैं।
हमारे मूल्य निर्धारण की जाँच करें या यदि आप चाहते हैं कि आपका अपना मॉडल हमारे स्टैक पर तैनात किया जाए, तो पहुंचें।