I2V-A14B 图生视频:让静态图片"动起来"
I2V 和 T2V 的区别
I2V(Image-to-Video)在 T2V 的基础上多了一个首帧约束——你提供一张参考图作为视频的第一帧,模型在这个约束下生成后续帧。
这带来了两个好处:
- 更精准的场景起点:不会像纯文生那样"跑偏"
- 更强的一致性:图片里的人物、商品、文字在后续帧里能保持基本不变
Wan2.2 的 I2V 模型相比 2.1 版本,在产品一致性和人像一致性上有明显提升——这也是 2.2 最强调的改进点。
最小命令
python generate.py \
--task i2v-A14B \
--size 1280*720 \
--ckpt_dir ./Wan2.2-I2V-A14B \
--image examples/i2v_input.JPG \
--offload_model True \
--convert_model_dtype \
--prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside."
和 T2V 相比,主要差异:
--task i2v-A14B- 新增
--image参数,指向你的参考图 --size在 I2V 中表示生成视频的面积,宽高比会自动跟随输入图片
没有 prompt 也能生成
I2V 模型可以完全不写 prompt,只靠参考图来生成——它会自动从图片"脑补"出运动:
DASH_API_KEY=your_key torchrun --nproc_per_node=8 generate.py \
--task i2v-A14B \
--size 1280*720 \
--ckpt_dir ./Wan2.2-I2V-A14B \
--prompt "" \
--image examples/i2v_input.JPG \
--use_prompt_extend \
--prompt_extend_method dashscope
这里用 DashScope API 自动从参考图生成 prompt(内部会用 qwen-vl-max 视觉语言模型看图写描述),效果通常比空 prompt 好。
运镜控制
Wan2.2-I2V 支持运镜控制(Camera Control)。在 prompt 里描述镜头的推拉摇移(如"镜头缓慢推近"、"从左向右平移"、"环绕拍摄"),模型会按你描述的方式生成镜头运动。这是 Wan2.2 比同类闭源模型更强的一点。
常用的运镜描述词:
| 运镜 | 英文示例 |
|---|---|
| 推近 | Camera slowly pushes in / Close-up shot |
| 拉远 | Camera pulls back / Wide establishing shot |
| 平移 | Camera pans from left to right |
| 环绕 | Camera orbits around the subject |
| 跟随 | Camera tracks the subject |
和 TI2V-5B 的选择
I2V-A14B 效果更好(尤其是一致性和运镜),但需要 80GB 显存。如果你只有 4090,就用 TI2V-5B + --image 参数——虽然没有 MoE,但它同样支持图生视频。详见 4090 本地跑。