模型能力

图像转视频

查看 Markdown

提供源图像和可选 prompt,即可将静态图像转换为视频。模型会根据你的指令让图像内容动起来。在 grok-imagine-video-1.5 上,图生视频支持原生 1080p。仅发送 image 属于图生视频。将其与 last_framekeyframesreference_images 组合使用时,属于以该图像为固定首帧的参考图生视频。请参阅 首帧与尾帧关键帧

可以通过以下方式提供源图像:

下方演示展示了实际效果;按住即可让静态图像动起来:

延时摄影
加载视频...
按住播放
import os
import xai_sdk

client = xai_sdk.Client(api_key=os.getenv("XAI_API_KEY"))

response = client.video.generate(
    prompt="Generate a slow and serene time-lapse",
    model="grok-imagine-video-1.5",
    image_url="https://docs.x.ai/assets/api-examples/video/milkyway-still.png",
    duration=12,
)

print(response.url)

在 Vercel AI SDK 中,prompt 参数接受一个包含 imagetext 字段的对象,用于图像转视频生成。 image 字段可以是 URL 字符串、Base64 编码的字符串、Uint8ArrayArrayBufferBuffer



最后更新:2026 年 9 月 21 日