generate_image
Create new images or modify existing ones using text prompts and visual references with Grok Imagine's AI models.
Instructions
Generate new images or edit existing ones with Grok Imagine.
Pass `image_paths` and/or `image_urls` to edit images or use them as
visual references. Multiple references are combined in a single call.
Args:
prompt: Image description, or the edit instruction when references are provided.
model: Image model (`grok-imagine-image` or `grok-imagine-image-pro`).
image_paths: Local image files (JPG/PNG) used as edit sources or references.
image_urls: Public image URLs used as edit sources or references.
n: Number of images to generate (1–10).
image_format: `"url"` (default) or `"base64"`.
aspect_ratio: Aspect ratio like `"16:9"`, `"1:1"`, or `"9:16"`.
resolution: `"1k"` or `"2k"`.
Returns:
Markdown block with each generated image URL and any revised prompt.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| model | No | grok-imagine-image | |
| image_paths | No | ||
| image_urls | No | ||
| n | No | ||
| image_format | No | url | |
| aspect_ratio | No | ||
| resolution | No |