Model Details
Grok Imagine Image generates high-quality images from a text prompt. Describe the scene, style, subject, and composition in natural language and it returns one to four rendered images. It handles photorealistic scenes, illustration, and stylized art, follows detailed multi-part prompts, and lets you pick the framing (aspect ratio) and a standard or high-resolution output. Put any text you want rendered inside the image in the prompt.
## Best for - Turning a written description into a finished image (concept art, product mockups, marketing visuals) - Photorealistic scenes and portraits from a detailed prompt - Illustration, digital painting, and stylized art directed entirely by text - Generating several variations of one idea in a single request (`num_images` up to 4) - Wide, tall, or square social and banner formats via the aspect-ratio presets
## Choose another model when - You want to modify or restyle an existing image rather than create one from scratch — use an image-editing model - You need to animate a prompt or a still into motion — use a text-to-video or image-to-video model - You need vector/SVG output rather than a raster image — use a vectorization model
## Tips - Be specific about subject, setting, lighting, and style; longer, structured prompts follow more reliably - Choose `aspect_ratio` to match the target format (e.g. `16:9` for banners, `9:16` for stories, `1:1` for avatars) - Set `resolution` to `2k` when you need extra detail for print or large displays; `1k` is the faster standard tier - Raise `num_images` to compare several takes at once — each generated image is billed
## Advanced Configuration - `output_format` selects the file type: `jpeg` (default, smallest), `png` (lossless), or `webp` (compact with transparency support).
To run via the ModelRunner JavaScript client: ```js import { modelrunner } from "@modelrunner/client";
const result = await modelrunner.subscribe("xai/grok-imagine/image", { input: { prompt: "a red vintage bicycle leaning against a pastel blue wall, soft morning light", aspect_ratio: "16:9", resolution: "1k", num_images: 1, }, }); ```





