Grok Imagine Image 2.0
import { experimental_generateImage as generateImage } from 'ai';
const result = await generateImage({ model: 'spacexai/grok-imagine-image-2.0', prompt: 'A red balloon on a wooden table.'});Copy link to headingFrequently Asked Questions
What is Grok Imagine Image 2.0 built for?
Text-to-image generation and image editing, with an emphasis on keeping a subject, style, or product consistent across edits.
How do I call Grok Imagine Image 2.0 on AI Gateway?
Use
generateImagefrom the AI SDK withspacexai/grok-imagine-image-2.0. To edit an existing image, pass images in the prompt. The Chat Completions, Responses, and Messages APIs do not serve image generation.How many reference images can Grok Imagine Image 2.0 take?
Up to five at once. Use them to hold a character, style, or product consistent across a set of generations.
How many images can one request return?
Up to 10, at 1K or 2K resolution.
How does Grok Imagine Image 2.0 price image edits?
An edit bills for both the input image and the output image. See the pricing panel on this page for current rates, and budget for the number of passes an iterative workflow takes.
Can Grok Imagine Image 2.0 render text inside an image?
Yes, and it plans layout and small text deliberately, which makes it suitable for posters and mockups. Text compliance is weaker in Simplified Chinese than in English, so verify localised assets before shipping.
Can Grok Imagine Image 2.0 change one part of an image?
Yes. Point at a region to edit only that area, use segmentation to select precise areas, or remove the background to export the subject on transparency.
Does Grok Imagine Image 2.0 support Zero Data Retention?
Zero Data Retention is not currently available for this model. Zero Data Retention is offered on a per-provider basis. See https://vercel.com/docs/ai-gateway/capabilities/zdr for details.