Grok Imagine Image Text to Image API

xai/grok-imagine-image/text-to-image
5 aspect ratios

Grok Imagine Image Text to Image turns text into realistic or stylized images, combining subject detail with lighting and composition. Written descriptions guide the scene’s appearance, while five aspect ratios fit portraits, product concepts, and social visuals.

Get API Key
Input
629/5000

Examples

The Record Conservator

An intimate documentary photograph inside a small old vinyl record restoration room. A young adult male technician with a silver buzz cut and round face gently holds a carbon-fiber record brush against a black vinyl record lying flat on a workbench. His other hand steadies the outer edge. Frame his face, shoulders and both hands together, believable fingers and a single brush. Slanting side-window daylight reveals the fine grooves and a few dust particles, with worn wooden shelves softly out of focus. Quiet concentration, natural skin texture, warm understated color, candid rather than posed. No readable labels, branding, promotional graphics, or watermark.

Lynx Behind the Fallen Trunk

An eye-level wildlife photograph of one Eurasian lynx peeking around the right side of a snow-covered fallen tree trunk in a boreal conifer forest. Show its head and forequarters with accurate feline anatomy, prominent black ear tufts, amber eyes, white cheek ruff and naturally damp whiskers. Its paws stand on undisturbed snow. Soft cool morning light, fine individual fur strands, a small amount of distant mist between spruce trunks, softly blurred background, realistic wildlife observation. No other animals, people, text, logos, or watermark.

Grok Imagine Image Text to Image

Grok Imagine Image Text to Image is xAI’s model for creating images from written descriptions, spanning photographic scenes and illustrated styles. It interprets the subject, setting, lighting, and composition together, so a creative brief can become a portrait, a product concept, or a scene illustration. Five output aspect ratios let the same creative direction fit square posts, portrait layouts, and widescreen compositions.

Why Choose Grok Imagine Image Text to Image?

  • Realistic and illustrated directionsExplore a photographic scene or an illustrated treatment through the same text input, making it useful for comparing visual directions early in a project.

  • A scene built from the briefSubject, surroundings, light, and framing are expressed together in the prompt, giving a concept a visual form before a reference image exists.

  • Composition for the intended placementSquare, portrait, and landscape outputs give portraits, social posts, and scene concepts a frame suited to their destination.

Parameters

ParameterRequirementDescription
promptRequired

Describe the desired image and visual style. Enter 1–5,000 characters.

sizeOptional

Choose 1:1, 2:3, 3:2, 16:9, or 9:16.

1:12:33:216:99:16

How to Use

  1. Describe the imageEnter the subject, setting, lighting, and visual style.

  2. Choose the output frameSelect Size for a portrait, social post, or landscape scene.

  3. Run and view the resultReview the price and select Run, then preview and download the completed result.

Pricing

One credit equals $0.005.

UsageRateDetails
Image generation6 credits / image$0.030 / image

Use Cases

  • Product concept boardsTurn a description of an imagined object, material, and setting into a visual concept for discussing a product’s look.

  • Portrait art directionCombine a character description, pose, light, and photographic or illustrated style to explore a portrait concept.

  • Social illustrationsCreate a scene around a post’s subject and choose a square or vertical composition for the accompanying visual.

Prompt Tips

  • Start with the main subject, then describe its setting, position, and scale within the frame.
  • For a photographic look, specify materials, lighting direction, and viewpoint; for illustration, name the medium and palette.
  • Choose size to match the intended layout, and mention any space needed around the subject.
  • Keep the main scene description while changing one visual choice, such as lighting or style, to compare directions.

Usage Notes

  • Save the task_id to retrieve the result, or provide callback_url for a completion notification.

Related Models

Grok Imagine Image Text to Image API frequently asked questions

What is the Grok Imagine Image Text to Image API?

Grok Imagine Image Text to Image is an xAI model for turning text descriptions into images. It creates realistic and stylized scenes with control through subject, lighting, and composition descriptions. Text provides the visual brief, and the selected aspect ratio sets the output frame for a portrait, product concept, or illustration. You can call it through the API or try it in the Playground tab.

Can Grok Imagine Image Text to Image create photographic scenes?

Yes. Describe the subject, materials, surroundings, and light for a photographic direction, such as a ceramic cup on a wooden table in soft window light. The image is generated from that written scene.

How does Grok Imagine Image Text to Image handle illustrated styles?

Describe the illustration medium and visual treatment in prompt, such as watercolor with a muted palette or a flat editorial illustration. The subject and setting can stay the same while you explore a different style.

Which aspect ratios does Grok Imagine Image Text to Image offer?

The size field accepts 1:1, 2:3, 3:2, 16:9, and 9:16. Choose the frame for the intended placement, then describe the subject’s position and surrounding space in the prompt.

When should I choose Grok Imagine Image Text to Image instead of Grok Imagine Image Edit?

Choose Grok Imagine Image Text to Image when the starting point is a written scene or creative brief. Choose Grok Imagine Image Edit when an existing image is the starting point and you want to describe changes to it.

Can I animate a Grok Imagine Image Text to Image result?

Yes. Use the generated image as the reference for Grok Imagine Video Image to Video, then describe the desired motion. This is a separate generation step that produces a 6- or 10-second clip.

What does one Grok Imagine Image Text to Image generation cost?

Each image costs 6 credits ($0.030). The same price applies to the five available size values.