Skip to main content
Endpoint: POST https://fal.run/xai/grok-imagine-image Endpoint ID: xai/grok-imagine-image

Try it in the Playground

Run this model interactively with your own prompts.

Quick Start

import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "xai/grok-imagine-image",
    arguments={
        "prompt": "Abstract human silhouette, golden particles ready to burst outward representing joy, data visualization style, emotional expression through particles, artistic scientific"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)

Input Schema

prompt
string
required
Text description of the desired image.
num_images
integer
default:"1"
Number of images to generate. Default value: 1Range: 1 to 4
aspect_ratio
AspectRatioEnum
default:"1:1"
Aspect ratio of the generated image. Default value: "1:1"Possible values: 2:1, 20:9, 19.5:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:19.5, 9:20, 1:2
resolution
ResolutionEnum
default:"1k"
Resolution of the generated image. 1k for standard resolution, 2k for high resolution. Default value: "1k"Possible values: 1k, 2k
output_format
OutputFormatEnum
default:"jpeg"
The format of the generated image. Default value: "jpeg"Possible values: jpeg, png, webp
sync_mode
boolean
default:"false"
If True, the media will be returned as a data URI and the output data won’t be available in the request history.

Output Schema

images
list<ImageFile>
required
The URL of the generated image.
revised_prompt
string
required
The enhanced prompt that was used to generate the image.

Input Example

{
  "prompt": "Abstract human silhouette, golden particles ready to burst outward representing joy, data visualization style, emotional expression through particles, artistic scientific",
  "num_images": 1,
  "aspect_ratio": "1:1",
  "resolution": "1k",
  "output_format": "jpeg",
  "sync_mode": false
}

Output Example

{
  "images": [
    {
      "url": "https://v3b.fal.media/files/b/0a8b90b7/9avg_nKJmcVinjQHJR_Ja.jpg"
    }
  ],
  "revised_prompt": ""
}

Limitations

  • num_images range: 1 to 4
  • resolution restricted to: 1k, 2k
  • output_format restricted to: jpeg, png, webp