- Image To Video
- Text To Video
- Reference To Video
- Edit Video
- Extend Video
Endpoint:
POST https://fal.run/xai/grok-imagine-video/image-to-video
Endpoint ID: xai/grok-imagine-video/image-to-videoTry 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
Text description of desired changes or motion in the video.
Video duration in seconds. Default value:
6Range: 1 to 15Aspect ratio of the generated video. Default value:
autoPossible values: auto, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16Resolution of the output video. Default value:
"720p"Possible values: 480p, 720pURL of the input image for video generation.
Output Schema
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
}
}
Endpoint:
POST https://fal.run/xai/grok-imagine-video/text-to-video
Endpoint ID: xai/grok-imagine-video/text-to-videoTry 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/text-to-video",
arguments={
"prompt": "Anime schoolgirl bursting out of house door, cherry blossoms blowing, morning light, speed lines indicating rush, chibi-ready expressions, classic shojo aesthetic, vibrant colors"
},
with_logs=True,
on_queue_update=on_queue_update,
)
print(result)
Input Schema
Text description of the desired video.
Video duration in seconds. Default value:
6Range: 1 to 15Aspect ratio of the generated video. Default value:
"16:9"Possible values: 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16Resolution of the output video. Default value:
"720p"Possible values: 480p, 720pOutput Schema
The generated video.
Input Example
{
"prompt": "Anime schoolgirl bursting out of house door, cherry blossoms blowing, morning light, speed lines indicating rush, chibi-ready expressions, classic shojo aesthetic, vibrant colors",
"duration": 6,
"aspect_ratio": "16:9",
"resolution": "720p"
}
Output Example
{
"video": {
"content_type": "video/mp4",
"duration": 6.041667,
"file_name": "RUAbFYlssdqnbjNLmE8qP_IX7BNYGP.mp4",
"fps": 24,
"height": 720,
"num_frames": 145,
"url": "https://v3b.fal.media/files/b/0a8b90e4/RUAbFYlssdqnbjNLmE8qP_IX7BNYGP.mp4",
"width": 1280
}
}
Endpoint:
POST https://fal.run/xai/grok-imagine-video/reference-to-video
Endpoint ID: xai/grok-imagine-video/reference-to-videoTry 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/reference-to-video",
arguments={
"prompt": "A @Image1 running through a sunlit meadow, cinematic slow motion",
"reference_image_urls": [
"https://v3b.fal.media/files/b/0a8b90e0/BFLE9VDlZqsryU-UA3BoD_image_004.png"
]
},
with_logs=True,
on_queue_update=on_queue_update,
)
print(result)
Examples
This man walking in this road between columns
This man walking in this road between columns
Input Schema
Text prompt describing the video to generate. Use @Image1, @Image2, etc. to reference specific images from reference_image_urls in order.
One or more reference image URLs to guide the video generation as style and content references. Reference in prompt as @Image1, @Image2, etc. Maximum 7 images.
Video duration in seconds. Default value:
8Range: 1 to 10Aspect ratio of the generated video. Default value:
"16:9"Possible values: 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16Resolution of the output video. Default value:
"480p"Possible values: 480p, 720pOutput Schema
The generated video.
Input Example
{
"prompt": "A @Image1 running through a sunlit meadow, cinematic slow motion",
"reference_image_urls": [
"https://v3b.fal.media/files/b/0a8b90e0/BFLE9VDlZqsryU-UA3BoD_image_004.png"
],
"duration": 8,
"aspect_ratio": "16:9",
"resolution": "480p"
}
Output Example
{
"video": {
"content_type": "video/mp4",
"duration": 8,
"file_name": "r2v_output.mp4",
"fps": 24,
"height": 720,
"num_frames": 192,
"url": "https://v3b.fal.media/files/b/0a8b90e4/r2v_output.mp4",
"width": 1280
}
}
Endpoint:
POST https://fal.run/xai/grok-imagine-video/edit-video
Endpoint ID: xai/grok-imagine-video/edit-videoTry 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/edit-video",
arguments={
"prompt": "Colorize the video",
"video_url": "https://v3b.fal.media/files/b/0a8b9112/V5Z_NIPE3ppMDWivNo6_q_video_019.mp4"
},
with_logs=True,
on_queue_update=on_queue_update,
)
print(result)
Input Schema
Text description of the desired edit.
URL of the input video to edit. The video will be resized to a maximum area of 854x480 pixels and truncated to 8 seconds.
Resolution of the output video. Default value:
"auto"Possible values: auto, 480p, 720pOutput Schema
The generated video.
Input Example
{
"prompt": "Colorize the video",
"video_url": "https://v3b.fal.media/files/b/0a8b9112/V5Z_NIPE3ppMDWivNo6_q_video_019.mp4",
"resolution": "auto"
}
Output Example
{
"video": {
"content_type": "video/mp4",
"duration": 5.041667,
"file_name": "EuDrZuQTW9m1phBXOsauz_EpJH3s8X.mp4",
"fps": 24,
"height": 720,
"num_frames": 121,
"url": "https://v3b.fal.media/files/b/0a8b9113/EuDrZuQTW9m1phBXOsauz_EpJH3s8X.mp4",
"width": 1280
}
}
Endpoint:
POST https://fal.run/xai/grok-imagine-video/extend-video
Endpoint ID: xai/grok-imagine-video/extend-videoTry 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/extend-video",
arguments={
"prompt": "The camera slowly zooms out to reveal the city skyline at sunset",
"video_url": "https://v3b.fal.media/files/b/0a8b9112/V5Z_NIPE3ppMDWivNo6_q_video_019.mp4"
},
with_logs=True,
on_queue_update=on_queue_update,
)
print(result)
Examples
Clouds timelapse there are mountains behind
Input Schema
Text description of what should happen next in the video.
URL of the source video to extend. Must be MP4 format (H.264, H.265, or AV1 codec), 2-15 seconds long.
Length of the extension in seconds. Default value:
6Range: 2 to 10Output Schema
The extended video (original + extension stitched together).
Input Example
{
"prompt": "The camera slowly zooms out to reveal the city skyline at sunset",
"video_url": "https://v3b.fal.media/files/b/0a8b9112/V5Z_NIPE3ppMDWivNo6_q_video_019.mp4",
"duration": 6
}
Output Example
{
"video": {
"content_type": "video/mp4",
"duration": 16,
"file_name": "extended_video.mp4",
"fps": 24,
"height": 720,
"num_frames": 384,
"url": "https://v3b.fal.media/files/b/0a8b9113/extended_video.mp4",
"width": 1280
}
}
Related
- Grok Imagine Video — Video Generation
- Grok Imagine Reference to Video — Video Generation
- Grok Imagine Extend Video — Video Generation
Limitations
durationrange: 1 to 15aspect_ratiorestricted to:auto,16:9,4:3,3:2,1:1,2:3,3:4,9:16resolutionrestricted to:480p,720paspect_ratiorestricted to:16:9,4:3,3:2,1:1,2:3,3:4,9:16durationrange: 1 to 10resolutionrestricted to:auto,480p,720pdurationrange: 2 to 10