All models

Grok Imagine Image Quality

xai/grok-imagine-image-quality
xAI Image GenerationImage EditingMultimodalText RenderingHigh Quality

xAI's higher-fidelity text-to-image model optimized for sharper details, more accurate compositions, and stronger text rendering. Supports image editing via reference images and masks. Trades speed for quality compared to grok-imagine-image. Default output at 2k resolution.

Quick start

# Inspect the price — a plain request returns the 402 challenge:
curl -i https://api.glianalabs.com/v1/infer \
  -H "content-type: application/json" \
  -d '{
    "model": "xai/grok-imagine-image-quality",
    "prompt": "<your prompt>"
  }'

# Pay + run in one step with the mppx CLI (create a wallet: npx mppx account create):
npx mppx https://api.glianalabs.com/v1/infer \
  -J '{"model": "xai/grok-imagine-image-quality", "prompt": "<your prompt>"}'

Examples

example
example
example
example
example

Parameters

Input
prompt string required

Text prompt describing what to generate.

aspect_ratio string optional

Output aspect ratio (e.g. 16:9, 1:1, 9:16).

image object optional

Input image (HTTPS URL or upload) to guide or edit from.

images array optional

Reference images to guide generation.

mask object optional

Mask image marking the region to edit (inpaint).

n integer optional

How many outputs to generate.

quality string optional

Output quality level.

resolution string optional

Output resolution / quality tier.

response_format string optional default: "b64_json"

How the result is returned (e.g. a URL or base64 data).

user string optional

Optional end-user identifier for abuse monitoring; not required.

Output
image: Generated image. Either a base64 data URI (`data:image/png;base64,...`) or an `https://` URL, depending on the upstream `response_format` (defaults to base64).