图像转视频
通过 inference.sh CLI 将静态图像转换为动画视频。
快速开始
需要 inference.sh CLI (
infsh)。安装说明
infsh login
# 生成静态图像
infsh app run falai/flux-dev-lora --input '{
"prompt": "夕阳下宁静的山间湖泊,平静的水面倒映着雪峰,金色阳光,风景摄影",
"width": 1248,
"height": 832
}'
# 为图像添加动画
infsh app run falai/wan-2-5-i2v --input '{
"prompt": "湖面泛起轻柔涟漪,云彩缓缓移动,温暖的阳光变化,远处鸟儿飞翔",
"image": "path/to/lake-image.png"
}'
模型选择
| 模型 | 应用 ID | 最佳用途 | 运动风格 |
|---|---|---|---|
| Wan 2.5 i2v | falai/wan-2-5-i2v | 逼真运动、自然移动 | 照片级真实、微妙 |
| WAN-I2V (Pruna) | pruna/wan-i2v | 经济、快速、480p/720p | 自然、高效 |
| Seedance 1.5 Pro | bytedance/seedance-1-5-pro | 风格化、创意、动画效果 | 艺术、富有表现力 |
| Seedance 1.0 Pro | bytedance/seedance-1-0-pro | 通用,质量好 | 均衡 |
| Fabric 1.0 | falai/fabric-1-0 | 布料、织物、液体、流动材质 | 基于物理的流动 |
| Grok Imagine Video | xai/grok-imagine-video | 通用动画、文本引导 | 多功能 |
何时使用各模型
| 场景 | 最佳模型 | 原因 |
|---|---|---|
| 有水面/云彩的风景 | Wan 2.5 i2v | 最适合自然、逼真的运动 |
| 带有微妙表情的肖像 | Wan 2.5 i2v | 保持面部保真度 |
| 带有布料/织物的产品 | Fabric 1.0 | 专攻材质物理 |
| 旗帜飘扬、窗帘飘动 | Fabric 1.0 | 布料模拟 |
| 插画/艺术图像 | Seedance | 匹配风格化内容 |
| 通用的“赋予生命” | Seedance 1.5 Pro | 良好的全能型 |
| 快速测试/迭代 | Seedance 1.0 Lite | 最快,720p |
运动类型
摄像机运动
| 运动 | 提示关键词 | 效果 |
|---|---|---|
| 推近 / 轨道车前进 | "slow dolly forward", "camera pushes in" | 增加亲密感/焦点 |
| 拉远 / 轨道车后退 | "camera pulls back", "slow zoom out" | 揭示、上下文 |
| 左右平移 | "camera pans slowly to the right" | 扫描、跟随 |
| 上下倾斜 | "camera tilts upward" | 揭示高度 |
| 环绕 | "camera orbits around the subject" | 3D 探索 |
| 升降 | "camera rises upward" | 宏大揭示 |
| 静态 | (无摄像机运动提示) | 仅主体运动 |
主体运动
| 类型 | 提示示例 |
|---|---|
| 自然元素 | "水起涟漪", "云彩飘动", "树叶在微风中沙沙作响" |
| 头发/衣物 | "头发在风中轻轻飘动", "裙子布料飘动" |
| 大气效果 | "雾气缓缓翻滚", "光束中的尘埃粒子浮动" |
| 角色 | "人物缓慢转向镜头", "细微的呼吸动作" |
| 机械 | "齿轮转动", "钟表指针移动" |
| 液体 | "咖啡蒸汽升腾", "颜料滴落", "水在流淌" |
提示最佳实践
黄金法则:微妙 > 戏剧化
AI 视频模型在 柔和、微妙的运动 上比剧烈动作能产生更好的效果。请求太多运动会导致扭曲和伪影。
❌ "人在奔跑并跳过障碍物,同时摄像机旋转"
✅ "人缓慢向前走,微风轻拂,摄像机跟随侧行"
❌ "爆炸,碎片四处飞溅"
✅ "烛光轻轻闪烁,温暖的氛围光变化"
❌ "快速缩放到眼睛,伴有剧烈的摄像机抖动"
✅ "向主体缓慢推进,轻微的焦点转移"
提示结构
[摄像机运动] + [主体运动] + [大气效果] + [情绪/节奏]
按场景的示例
# 风景动画
infsh app run falai/wan-2-5-i2v --input '{
"prompt": "gentle camera pan right, water reflecting moving clouds, trees swaying slightly in breeze, warm golden light, peaceful and slow",
"image": "landscape.png"
}'
# 肖像动画
infsh app run falai/wan-2-5-i2v --input '{
"prompt": "subtle breathing motion, slight head turn, natural eye blink, hair moving gently, soft ambient lighting shifts",
"image": "portrait.png"
}'
# 产品镜头动画
infsh app run bytedance/seedance-1-5-pro --input '{
"prompt": "slow 360 degree orbit around the product, gentle spotlight movement, subtle reflections shifting, premium product showcase, smooth motion",
"image": "product.png"
}'
# 布料/织物动画
infsh app run falai/fabric-1-0 --input '{
"prompt": "fabric flowing and rippling in gentle wind, natural cloth physics, soft movement",
"image": "fabric-scene.png"
}'
# 建筑可视化
infsh app run falai/wan-2-5-i2v --input '{
"prompt": "slow dolly forward through the entrance, slight camera tilt upward, ambient light filtering through windows, dust particles in light beams",
"image": "building-interior.png"
}'
时长指南
| 时长 | 质量 | 用途 |
|---|---|---|
| 2-3 秒 | 最高质量 | GIF、循环背景、动态照片 |
| 4-5 秒 | 高质量 | 社交媒体帖子、产品展示 |
| 6-8 秒 | 良好质量 | 短视频片段、转场 |
| 10+ 秒 | 质量下降 | 除非拼接较短的片段,否则应避免 |
延长时长
对于更长的视频,生成多个短片段并拼接:
# 从同一张图像生成 3 个具有渐进运动的片段
infsh app run falai/wan-2-5-i2v --input '{
"prompt": "slow pan left, gentle water motion",
"image": "scene.png"
}' --no-wait
infsh app run falai/wan-2-5-i2v --input '{
"prompt": "continuing pan, clouds shifting, light changing",
"image": "scene.png"
}' --no-wait
# 拼接在一起
infsh app run infsh/media-merger --input '{
"media": ["clip1.mp4", "clip2.mp4"]
}'
完整工作流
静态到最终视频流水线
# 1. 生成源图像(最佳质量)
infsh app run bytedance/seedream-4-5 --input '{
"prompt": "cinematic landscape, misty mountains at dawn, lake in foreground, dramatic clouds, golden hour, 4K quality, professional photography",
"size": "2K"
}'
# 2. 为图像添加动画
infsh app run falai/wan-2-5-i2v --input '{
"prompt": "gentle mist rolling through the valley, lake surface rippling, clouds slowly moving, birds in distance, warm light shifting",
"image": "landscape.png"
}'
# 3. 根据需要放大视频
infsh app run falai/topaz-video-upscaler --input '{
"video": "animated-landscape.mp4"
}'
# 4. 添加环境音频
infsh app run infsh/hunyuanvideo-foley --input '{
"video": "animated-landscape.mp4",
"prompt": "gentle nature ambience, distant birds, soft wind, water lapping"
}'
# 5. 将视频与音频合并
infsh app run infsh/video-audio-merger --input '{
"video": "upscaled-landscape.mp4",
"audio": "ambient-audio.mp3"
}'
动态照片效果
动态照片是一种静态照片,其中只有一个元素在移动(例如,在一个其他部分都静止的场景中瀑布流动)。要实现这一点:
- 生成静态图像,并清晰定义运动元素
- 仅针对该特定元素提示运动
- 保持 2-4 秒以实现无缝循环
infsh app run falai/wan-2-5-i2v --input '{
"prompt": "only the waterfall is moving, everything else remains perfectly still, water cascading smoothly, rest of scene frozen",
"image": "waterfall-scene.png"
}'
常见错误
| 错误 | 问题 | 修复 |
|---|---|---|
| 请求过多的运动 | 扭曲、伪影、变形 | 微妙 > 戏剧化,始终如此 |
| 内容类型与模型不匹配 | 结果差 | 使用上面的选择指南 |
| 片段过长(10 秒以上) | 质量显著下降 | 保持 3-5 秒,如果需要则拼接 |
| 未指定摄像机运动 | 随机/不可预测的运动 | 始终指定摄像机行为 |
| 冲突的运动方向 | 混乱、不自然 | 一个主要的运动方向 |
| 低分辨率源图像 | 低分辨率视频输出 | 从最高质量的源开始 |
| 复杂的动作场景 | 模型无法处理 | 保持运动简单自然 |
相关技能
npx skills add inference-sh/skills@ai-video-generation
npx skills add inference-sh/skills@ai-image-generation
npx skills add inference-sh/skills@p-video
npx skills add inference-sh/skills@video-prompting-guide
npx skills add inference-sh/skills@prompt-engineering
浏览所有应用:infsh app list