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

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-video/image-to-video",
    arguments={
        "prompt": "Medieval knight in ornate armor walking through a mystical forest, bioluminescent plants pulsing with light, ancient stone ruins overgrown with glowing vines, over-the-shoulder camera, dark fantasy aesthetic, volumetric fog and Lumen lighting",
        "image_url": "https://v3b.fal.media/files/b/0a8b90e0/BFLE9VDlZqsryU-UA3BoD_image_004.png"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)

Input Schema

prompt
string
required
Text description of desired changes or motion in the video.
duration
integer
default:"6"
Video duration in seconds. Default value: 6Range: 1 to 15
aspect_ratio
Enum
default:"auto"
Aspect ratio of the generated video. Default value: autoPossible values: auto, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16
resolution
ResolutionEnum
default:"720p"
Resolution of the output video. Default value: "720p"Possible values: 480p, 720p
image_url
string
required
URL of the input image for video generation.

Output Schema

video
VideoFile
required
The generated video.

Input Example

{
  "prompt": "Medieval knight in ornate armor walking through a mystical forest, bioluminescent plants pulsing with light, ancient stone ruins overgrown with glowing vines, over-the-shoulder camera, dark fantasy aesthetic, volumetric fog and Lumen lighting",
  "duration": 6,
  "aspect_ratio": "auto",
  "resolution": "720p",
  "image_url": "https://v3b.fal.media/files/b/0a8b90e0/BFLE9VDlZqsryU-UA3BoD_image_004.png"
}

Output Example

{
  "video": {
    "content_type": "video/mp4",
    "duration": 6.041667,
    "file_name": "0Ci1dviuSnEyUZzBUq-_5_nu7MrAAa.mp4",
    "fps": 24,
    "height": 720,
    "num_frames": 145,
    "url": "https://v3b.fal.media/files/b/0a8b90e0/0Ci1dviuSnEyUZzBUq-_5_nu7MrAAa.mp4",
    "width": 1280
  }
}

Limitations

  • duration range: 1 to 15
  • aspect_ratio restricted to: auto, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16
  • resolution restricted to: 480p, 720p
  • aspect_ratio restricted to: 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16
  • duration range: 1 to 10
  • resolution restricted to: auto, 480p, 720p
  • duration range: 2 to 10