video-from-image
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVideo from Image
图片转视频
Animate a single image into a dynamic video using Google DeepMind's Veo 3.1 model via fal.ai.
See for setup, Python patterns, and error handling.
references/fal-api.md使用fal.ai调用Google DeepMind的Veo 3.1模型,将单张图片制作成动态视频。
如需了解设置方法、Python使用模式以及错误处理,请查看。
references/fal-api.mdAPI Endpoint
API接口
fal-ai/veo3.1/image-to-videofal-ai/veo3.1/image-to-videoParameters
参数
Required
必填参数
- (string): Text description of the video motion and action to generate
prompt - (string): URL of the input image to animate (use
image_urlfor local files)fal_client.upload_file()
- (字符串):用于描述要生成的视频的运动和动作的文本说明
prompt - (字符串):待动画处理的输入图片的URL(本地文件可使用
image_url上传)fal_client.upload_file()
Optional
可选参数
| Parameter | Type | Default | Options |
|---|---|---|---|
| string | "8s" | "4s", "6s", "8s" |
| string | "auto" | "auto", "9:16", "16:9" |
| string | "720p" | "720p", "1080p" |
| boolean | true | Disable to save ~50% credits |
| 参数 | 类型 | 默认值 | 可选值 |
|---|---|---|---|
| 字符串 | "8s" | "4s", "6s", "8s" |
| 字符串 | "auto" | "auto", "9:16", "16:9" |
| 字符串 | "720p" | "720p", "1080p" |
| 布尔值 | 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.mp4bash
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.mp4Tips
小贴士
- 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 () to save credits when sound is not needed
generate_audio: False - 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)生成速度更快,适合快速预览