X Ai Grok Imagine Image Text To Image
Playground
Try it on WavespeedAI!X-AI Grok Imagine Image enables precise image editing with xAI’s Grok Imagine model. Transform and modify images using text prompts with AI-powered precision. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Features
Grok Imagine Image Text-to-Image
Grok Imagine Image is X-AI’s text-to-image generation model that transforms text prompts into high-quality visuals. With extensive aspect ratio options and batch generation support, it delivers creative, detailed images for a wide range of applications.
Why Choose This?
-
Extensive aspect ratios 11 preset options including 2:1, 20:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, and 9:20.
-
Batch generation Generate up to 4 images in a single request for quick iteration.
-
Creative flexibility Excels at stylized content from 3D characters to photorealistic scenes.
-
Prompt Enhancer Built-in tool to automatically improve your prompts for better results.
-
Cost-effective Affordable per-image pricing for high-volume generation.
Parameters
| Parameter | Required | Description |
|---|---|---|
| prompt | Yes | Text description of the image you want to generate |
| aspect_ratio | No | Output ratio: 2:1, 20:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:20 |
| num_images | No | Number of images to generate (1-4, default: 1) |
How to Use
- Write your prompt — describe the image in detail, including style, mood, and composition.
- Select aspect ratio — choose from presets or leave empty for default.
- Set num_images — generate 1-4 images per request.
- Run — submit and download your images.
Pricing
| Output | Cost |
|---|---|
| Per image | $0.022 |
Billing Rules
- Total cost = $0.022 × num_images
- Maximum 4 images per request
Examples
- 1 image → $0.022
- 2 images → $0.044
- 4 images → $0.088
Best Use Cases
- Character Design — Create 3D characters, chibi figures, and toy-style illustrations.
- Social Media Content — Generate visuals for posts, stories, and ads.
- Concept Art — Quickly visualize ideas and creative concepts.
- Marketing Materials — Produce eye-catching imagery for campaigns.
- Rapid Prototyping — Generate multiple variations to explore design directions.
Pro Tips
- Use the Prompt Enhancer to refine your descriptions automatically.
- Be specific about style, texture, lighting, and color palette for better results.
- Generate multiple images (num_images=4) to explore variations quickly.
- Match aspect ratio to your target platform: 16:9 for YouTube, 9:16 for TikTok/Reels, 1:1 for Instagram.
- Use ultra-wide ratios (20:9, 2:1) for cinematic banners and headers.
Notes
- Maximum 4 images can be generated per request.
- Aspect ratio can be left empty to use default sizing.
- For best results, write detailed prompts with specific visual attributes.
Related Models
- Grok Imagine Image Edit — Edit existing images with text instructions.
Authentication
For authentication details, please refer to the Authentication Guide.
API Endpoints
Submit Task & Query Result
# Submit the task
curl --location --request POST "https://api.wavespeed.ai/api/v3/x-ai/grok-imagine-image/text-to-image" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}" \
--data-raw '{
"output_format": "jpeg"
}'
# Get the result
curl --location --request GET "https://api.wavespeed.ai/api/v3/predictions/${requestId}/result" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}"
Parameters
Task Submission Parameters
Request Parameters
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
| prompt | string | Yes | - | The positive prompt for the generation. | |
| aspect_ratio | string | No | - | 2:1, 20:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:20, 1:2 | Aspect ratio of the generated image. |
| output_format | string | No | jpeg | jpeg, png | Output image format. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data.id | string | Unique identifier for the prediction, Task Id |
| data.model | string | Model ID used for the prediction |
| data.outputs | array | Array of URLs to the generated content (empty when status is not completed) |
| data.urls | object | Object containing related API endpoints |
| data.urls.get | string | URL to retrieve the prediction result |
| data.has_nsfw_contents | array | Array of boolean values indicating NSFW detection for each output |
| data.status | string | Status of the task: created, processing, completed, or failed |
| data.created_at | string | ISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”) |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |
Result Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string | Yes | - | Task ID |
Result Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data | object | The prediction data object containing all details |
| data.id | string | Unique identifier for the prediction, the ID of the prediction to get |
| data.model | string | Model ID used for the prediction |
| data.outputs | string | Array of URLs to the generated content (empty when status is not completed). |
| data.urls | object | Object containing related API endpoints |
| data.urls.get | string | URL to retrieve the prediction result |
| data.status | string | Status of the task: created, processing, completed, or failed |
| data.created_at | string | ISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”) |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |