xAI: Grok Imagine Image 2.0
Grok Imagine Image 2.0 creates images from written briefs and edits existing images through natural-language instructions. xAI documents configurable quality, resolution and composition, multi-image references, style transfer and iterative refinement.
About the model
This description covers the model’s capabilities. Available in Ailoot inputs, outputs and options are listed for the selected method below.
Grok Imagine Image 2.0 is xAI’s image-generation and editing model. It takes a written description, or a description together with source images, and returns an image result. The producer’s named 2.0 profile covers creating a scene, changing an existing image, combining subjects from references and transforming visual style. Start by choosing whether you need a new composition or a specific change to material you already have.
Creating an image from a brief
Describe the main subject, its setting, the composition, lighting and visual treatment. Identify what the viewer should notice first and where the image will be used. For a product concept, an illustrative brief can describe a ceramic desk lamp on a pale stone table, soft window light, a close view of the material and open space for a separate headline. For an illustration, specify the characters, action and intended aesthetic instead of expecting a single style word to define the entire scene.
The producer documents one to ten output images from a generation request, with one as the default. Several results from the same brief provide alternatives to review; they do not guarantee an identical subject across every variation. Check the subject, composition and important details, then retain the version that best fits the brief. Keep the brief and selected variation together so later edits use the intended composition.
Composition, resolution and quality
The generation guide documents automatic aspect-ratio selection or an explicit ratio. Its listed choices include 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 19.5:9, 9:19.5, 20:9, 9:20, 21:9 and 5:2. Choose the shape around the intended placement: square for a compact tile, portrait for a vertical composition, or landscape for a wide scene. Specify the crop-sensitive subject and the space that the layout needs rather than relying on the aspect ratio alone.
The documented generation-resolution settings are 1k and 2k, with 1k as the default. Quality is a separate control with low, medium and auto choices. In xAI’s current guide, auto is the default and uses low for generation and medium for editing; an explicit low or medium setting pins that choice. Resolution and quality therefore describe different controls. State the visual details that matter and inspect them in the returned image rather than treating either setting as a guarantee of exact lettering, geometry or subject preservation.
Editing and transferring visual style
Supply the image to change and describe the requested change in relation to its visible content. A focused edit might ask to replace a dark wall with a light plaster surface while preserving the furniture arrangement, camera viewpoint and warm illumination. If the intent is a stylistic transformation, specify the desired treatment: the producer demonstrates photography, anime, oil painting, watercolor, pop art and pencil-sketch styles. Identify which elements should retain their appearance and which may change with the treatment.
The maker’s editing workflow accepts a source-image reference, encoded image data or a file identifier. For stored references, use fully uploaded PNG, JPEG or WebP images. Its guide also documents successive edits: use the result of one edit as the input to the next. This can turn a base composition into a more specific result through a furniture change followed by a lighting adjustment. Keep the original and the chosen intermediate image associated with each brief so that a later refinement can be checked against the intended composition.
Combining multiple references
The current multi-image guide allows up to five source images in one edit. Refer to them in their supplied order and give each a clear role, such as the subject from the first image and the environment from the second. The output ratio follows the first input image by default, with an explicit ratio available to override it. For a product-in-room concept, describe the product’s position, size and contact with the room’s surfaces, then ask to preserve the details that identify it. Review how the sources were combined instead of assuming that every element was copied without alteration.
Receiving and retaining the image
The producer returns a temporary image address by default and also documents encoded-image output. Retain the actual image promptly when it is needed as an asset. Its optional deferred workflow separates request acknowledgment from completion: a request identifier is followed by pending, done or failed status, and deferred results use the address response format with a documented 24-hour retention period. A submitted request or a pending status is not a finished image. Retain the completed image with its brief and chosen settings for later reuse.
A useful final artifact is an image that fits a defined scene, layout or edit brief. Inspect the full composition and its small details, especially the source subject, object boundaries, proportions and any lettering that carries meaning. For iterative work, change the instruction associated with the visible issue and use the selected result as the next reference. Keep the desired modification and preservation instructions concrete so that each result can be assessed against a specific creative purpose.
Ailoot Ultra · Images POST /v1/images/generations x-ai/grok-imagine-image-2.0
x-ai/grok-imagine-image-2.0Overview
Grok Imagine Image 2.0 creates images from written briefs and edits existing images through natural-language instructions. xAI documents configurable quality, resolution and composition, multi-image references, style transfer and iterative refinement.
- Accepted inputs
- Text · Images
- Results
- Images
Available in Ailoot · inputs & methods
Ailoot Ultra · Images POST /v1/images/generations
- Input types
text,image- Output types
image
| Field | Type | Requirement | Values & limits | Default |
|---|---|---|---|---|
Fieldmodel | Typestring | RequirementRequired | Values & limits x-ai/grok-imagine-image-2.0 | Default— |
Fieldprompt | Typestring | RequirementRequired | Values & limits Minimum length: 1 | Default— |
Fieldresolution | Typestring | RequirementOptional | Values & limits 1K, 2K | Default— |
Fieldaspect_ratio | Typestring | RequirementOptional | Values & limits 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 | Default— |
Fieldquality | Typestring | RequirementOptional | Values & limits low, medium | Default— |
Fieldn | Typeinteger | RequirementOptional | Values & limits Minimum: 1 Maximum: 1 | Default— |
Fieldinput_references | Typearray | RequirementOptional | Values & limits Minimum items: 0 Maximum items: 3 | Default— |
Fieldprovider | Typeobject | RequirementOptional | Values & limits | Default— |
Method parameters and lifecycle
| Parameter | Contract |
|---|---|
Parametercontent_type | Contractapplication/json |
Parameterrequired | Contractmodel, prompt |
Parametermaterial_types | Contracttext, image |
Lifecycle: synchronous_result_then_owned_library
GET /v1/media/tasks/{task_id} · actual returned task_id or media library record
GET /v1/media/assets/{asset_id}/content
GET /v1/media/assets
GET /v1/media/assets/{asset_id}
Pricing
How the final charge is calculated
The displayed rates estimate the cost before generation. The final charge is calculated from the cost recorded for the original generation. Measured output duration and forecast quantities are not the final billable quantity.
Tariff references do not add request options. Supported parameters are listed for the selected method.
- Fast mode
- Not specified When fast mode is selected
- Flex mode
- Not specified When flex mode is selected
- Maximum reasoning effort
- Not specified When maximum reasoning effort uses the default adjustment
Estimated rates for comparison
Prices by configuration
Match each charge to the conditions shown. Use one rate for each set of alternative configurations.
| Configuration | Rate schedule | Forecast quantity | Billing unit | Charge |
|---|---|---|---|---|
| ConfigurationBase token rates | Rate scheduleBase rate | Forecast quantity— | Billing unit— | Charge Input · Input tokens · Estimate for comparison only — / 1K tokens Output · Output tokens · Estimate for comparison only — / 1K tokens Input · Cache read · Estimate for comparison only — / 1K tokens Input · Cache write · Estimate for comparison only — / 1K tokens Input · Cache write, 1 hour · Estimate for comparison only — / 1K tokens |
| Configurationinput image | Rate schedule— | Forecast quantity— | Billing unitper input image | Charge Input · input image · Estimate for comparison only $0.02 per input image |
| ConfigurationEstimated generation cost | Rate schedule— | Forecast quantityone generation estimate | Billing unit— | Charge Output · Estimated generation cost · Estimate for comparison only $0.08 estimate before generation This estimate is not an additional charge or a fixed rate for the completed generation. |
Ailoot reserves an estimated amount before a request. After the result, it settles the final charge from measured usage. Streaming settlement uses the final usage record. How reservation and settlement work →
Example requests
Ailoot Ultra · Images
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p={'model': 'x-ai/grok-imagine-image-2.0', 'prompt': 'a red panda astronaut floating in space, studio lighting'}
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/images/generations \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin
def save_images(items):
if not items: raise SystemExit("No completed images; retain the full response")
for index, item in enumerate(items):
encoded=item.get("b64_json")
uri=item.get("url", "")
if not encoded and uri.startswith("data:image/"):
header, separator, encoded=uri.partition(",")
if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
if encoded:
raw=base64.b64decode(encoded,validate=True)
elif uri:
uri=urljoin("https://api.ailoot.ai",uri)
parsed=urlsplit(uri)
if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
raise SystemExit("Invalid returned image URL")
owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
args=["curl","--fail-with-body","--silent","--show-error",uri]
if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
temporary=Path(f"image-{index}.bin")
subprocess.run(args+["-o",str(temporary)],check=True)
raw=temporary.read_bytes()
temporary.unlink()
else: raise SystemExit("Image has neither bytes nor URL")
if not raw: raise SystemExit("Empty image result")
ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
Path(f"image-{index}.{ext}").write_bytes(raw)
print("Every returned image saved; complete response metadata retained")
save_images(json.loads(Path("result.json").read_text())["data"])
PY_RESULT
Receive and save results
Ailoot Ultra · Images
Download each returned image or save its Base64 contents
GET /v1/media/tasks/{task_id}GET /v1/media/assets/{asset_id}/contentGET /v1/media/assetsGET /v1/media/assets/{asset_id}
Other content reads
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/media/assets \
-H "Authorization: Bearer $AILOOT_API_KEY" -o owned-assets.json
# Preserve every returned asset and follow its exact signed content URL. Do not construct a signed token.
Keep all completed results
Save every completed image; retrieve each returned URL or decode its Base64 contents.
Retain the complete response and headers, every actual output, original returned identifiers and all usage fields. Recover the original operation without submitting creation again.
If the original response needs checking
Keep the returned X-Client-Request-ID for reconciliation. Read only actual returned task_id/asset_id values or the owned media library; never build a task URL from the operation ID and never resubmit creation.
Response fields
| Field | Type |
|---|---|
Fieldcreated | Type |
Fielddata[].url | Type |
Fielddata[].b64_json | Type |
Fieldusage | Type |
Aliases
Model aliases
Ailoot Ultra x-ai/grok-imagine-image-2.0
Method path aliases
/v1/images
Related caller IDs
FAQ · xAI: Grok Imagine Image 2.0
- What inputs and results are available?
POST /v1/images/generations·x-ai/grok-imagine-image-2.0:text,image→image- Which fields does the request use?
POST /v1/images/generations·x-ai/grok-imagine-image-2.0:model,prompt,resolution,aspect_ratio,quality,n,input_references,provider- What limits apply?
POST /v1/images/generations·x-ai/grok-imagine-image-2.0:n.minimum:1;n.maximum:1