Skip to main content
Generate and edit images using xAI’s Grok Imagine model. Supports text-to-image generation and reference-based image editing.

Model

Parameters

When image_urls is provided, the model runs in edit mode — it merges or edits the reference images based on your prompt. Otherwise it generates a new image from the prompt.

Example Request

Text to Image

Image Editing

Image editing typically returns a single image_url; text-to-image returns image_urls (array).

Response (Text to Image)

Response (Image Editing)