Skip to main content
Model logo

Grok Imagine Image API

    Click or drag & dropPNG, JPG, WEBP, GIF · Max 100MB
    Enable Pro
    Upsample Prompt
    Enable NSFW
    Output

    Your generated image will appear here

    Grok Imagine Image

    What is Grok Imagine Image?

    Grok Imagine Image is the image generation route of xAI's Grok Imagine model. One endpoint covers both text-to-image and reference-guided edits: omit image_urls and the model generates from the prompt alone, or pass 1 to 5 reference URLs and the same call switches into edit mode anchored to those visuals. Output covers five aspect ratios (1:1, 2:3, 3:2, 9:16, 16:9), the same set as Grok Imagine video, so a composition can be mocked as a still and animated as a clip without re-prompting. Edit mode returns a single image. An enable_pro toggle routes the same prompt to a higher-quality sampling profile, and upsample_prompt lets the API expand short briefs before sampling.

    Key features of Grok Imagine Image

    Five features cover what you'll use in a real production loop.

    Text-to-image and reference edit on one endpoint

    Skip `image_urls` for fresh text-to-image. Pass 1 to 5 references and the same call switches into edit mode. No conditional routing in your client code, no second model id to manage.

    Default and Pro sampling on the same model

    Set `enable_pro` to `true` and the call routes to a higher-quality sampling profile, billed at the Pro price key. Default leaves it off for cheaper drafts. Same prompt, two budget points.

    Up to 5 references per edit call

    Edit mode takes 1 to 5 reference images. Use multiple references to anchor product geometry while rotating background or palette across runs, or to carry character identity across a campaign.

    Five aspect ratios that match Grok Imagine video

    1:1, 2:3, 3:2, 9:16, and 16:9. Same set as the video model, so a still mocked at 9:16 maps cleanly to a vertical clip without re-prompting per ratio.

    Best for

    Single endpoint, two workflows

    Text-to-image and reference edit run on the same call. The presence of `image_urls` flips the workflow with no conditional routing in your client.

    Two-track production runs

    Bulk drafts on default sampling, then re-roll the winners with `enable_pro` set to `true` for the final pass. Same prompt, two cost points.

    Multi-reference colourway swaps

    Up to 5 references per call lets you anchor product geometry while rotating background or palette across runs. Useful for catalogue spreads.

    Cross-platform social sizing

    The same prompt across 1:1, 9:16, and 16:9 generates a matched set without re-prompting per ratio. Pair with the Grok Imagine video model for consistent stills and clips.

    Underspecified briefs

    Turn on `upsample_prompt` and the API expands the input before sampling. Useful for product teams whose users write short prompts.

    NSFW workflows on permitted accounts

    A single `enable_nsfw` flag handles policy gating with no extra integration. Useful for moderated adult-content pipelines that need one supported provider.

    Variants

    Two output tracks plus a workflow switch driven by whether you pass references. All on one model id (xai/grok-imagine-image).

    Default

    Default sampling profile. Cheaper per call. Good for brainstorming, bulk runs, and any draft pass before locking the final version.

    Pro

    Set enable_pro to true and the call routes to a higher-quality sampling profile. Use it when the image is the deliverable: store hero shots, packaging mocks, anything leaving review.

    Text-to-image

    Omit image_urls. The model generates from the prompt alone. Good for fresh concept work where no reference exists yet.

    Reference-guided edit

    Pass 1 to 5 references via image_urls. The call switches to edit mode, anchoring the result to those visuals, and returns a single image. Useful for product photography, character continuity, and background swaps.

    Use cases

    Run a brainstorming loop on default sampling at 1:1 to pick a hero composition, then re-roll the winner on Pro with the same prompt for the final delivery file. Build a colourway sheet by uploading a flat product photo as a reference and running the same prompt at five aspect ratios in one batch. Anchor a brand campaign with up to 5 references per call so palette, geometry, and props stay consistent across an entire spread. Mock a vertical 9:16 still that you'll later animate with Grok Imagine video, since both models share the same five aspect ratios and prompt vocabulary.

    API examples

    Call Grok Imagine Image from any language by POSTing to /v1/tasks. Full parameter docs live at docs.unifically.com/models/image/xai/grok-imagine-image.

    curl -X POST https://api.unifically.com/v1/tasks \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "model": "xai/grok-imagine-image",
        "input": {
          "prompt": "A robot dancing in a field of sunflowers",
          "aspect_ratio": "16:9"
        }
      }'
    

    Successful submission returns a task_id. Poll GET /v1/tasks/<task_id> or set a callback_url on the request to receive the finished image URLs.

    FAQs

    People also ask

    Grok Imagine Image is the image route of xAI's Grok Imagine model. One endpoint covers both text-to-image (when you omit references) and reference-guided edits (when you pass 1 to 5 reference images). Edit mode returns one image per call.

    References are optional. Skip image_urls for pure text-to-image. Pass 1 to 5 URLs and the call switches to edit mode, with the model anchoring the result to those visuals. Useful for product photography, character continuity, and background swaps.

    Same model architecture, different sampling profile. Set enable_pro to true and the call routes to a higher-quality pass billed at the Pro price key. Default leaves it off, so you pay the standard rate.

    Set upsample_prompt to true and the API rewrites your text prompt before sampling, expanding short or vague briefs into a fuller description. Disable it when you want the model to take your prompt verbatim.

    Five. 1:1, 2:3, 3:2, 9:16, and 16:9. Same five ratios as Grok Imagine video, so the same composition can be mocked as an image and animated as a clip without re-prompting per ratio.

    Only on accounts with the policy enabled. Pass enable_nsfw: true on the call and, if the account is permitted, the result skips the safe-for-work filter. Without the flag, results stay safe-for-work.

    Edit mode (when image_urls is set as input) returns a single image_url. Text-to-image mode returns one or more images as image_urls.