video-from-image

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Video from Image

图片转视频

Animate a single image into a dynamic video using Google DeepMind's Veo 3.1 model via fal.ai.
See
references/fal-api.md
for setup, Python patterns, and error handling.
使用fal.ai调用Google DeepMind的Veo 3.1模型,将单张图片制作成动态视频。
如需了解设置方法、Python使用模式以及错误处理,请查看
references/fal-api.md

API Endpoint

API接口

fal-ai/veo3.1/image-to-video
fal-ai/veo3.1/image-to-video

Parameters

参数

Required

必填参数

  • prompt
    (string): Text description of the video motion and action to generate
  • image_url
    (string): URL of the input image to animate (use
    fal_client.upload_file()
    for local files)
  • prompt
    (字符串):用于描述要生成的视频的运动和动作的文本说明
  • image_url
    (字符串):待动画处理的输入图片的URL(本地文件可使用
    fal_client.upload_file()
    上传)

Optional

可选参数

ParameterTypeDefaultOptions
duration
string"8s""4s", "6s", "8s"
aspect_ratio
string"auto""auto", "9:16", "16:9"
resolution
string"720p""720p", "1080p"
generate_audio
booleantrueDisable to save ~50% credits
参数类型默认值可选值
duration
字符串"8s""4s", "6s", "8s"
aspect_ratio
字符串"auto""auto", "9:16", "16:9"
resolution
字符串"720p""720p", "1080p"
generate_audio
布尔值true关闭该选项可节省约50%的积分

CLI Script

CLI脚本

bash
python3 scripts/fal_generate.py \
    --endpoint video-from-image \
    --prompt "Camera slowly pans across the landscape" \
    --image /path/to/photo.jpg \
    --duration 8s \
    --video-resolution 1080p \
    --output video.mp4
bash
python3 scripts/fal_generate.py \
    --endpoint video-from-image \
    --prompt "Camera slowly pans across the landscape" \
    --image /path/to/photo.jpg \
    --duration 8s \
    --video-resolution 1080p \
    --output video.mp4

Tips

小贴士

  • Use descriptive motion language in prompts: pan, zoom, sway, flow, drift
  • Describe camera movements for cinematic effects: "slow dolly forward", "aerial pull back"
  • Higher resolution (1080p) gives better quality but takes longer and costs more
  • Disable audio generation (
    generate_audio: False
    ) to save credits when sound is not needed
  • Ensure input image is at least 720p for best results
  • Shorter duration (4s) generates faster and is good for quick previews
  • 在prompt中使用描述性的动作词汇:平移(pan)、缩放(zoom)、摇摆(sway)、流动(flow)、漂移(drift)
  • 描述相机运动以实现电影级效果:“缓慢向前推镜头(slow dolly forward)”、“空中拉远镜头(aerial pull back)”
  • 更高分辨率(1080p)画质更好,但生成时间更长、成本更高
  • 当不需要声音时,关闭音频生成(
    generate_audio: False
    )以节省积分
  • 确保输入图片分辨率至少为720p以获得最佳效果
  • 更短的时长(4s)生成速度更快,适合快速预览