Model reference · open weights
i2vgen-xl is an open-weight video model from ali-vilab. i2vgen-xl (FP32) weighs 2.5 GB; the smallest configuration that runs it is RTX 3060 12 GB.
Summary of the ali-vilab/i2vgen-xl model card, 2026-10-01
What it is
| Released by | ali-vilab |
|---|---|
| Released | 2023-12-15 |
| Parameters | 1.4B |
| VRAM | 2.5 GB for the weights |
What it runs on
| Card | Weights | Memory |
|---|---|---|
| RTX 3060 12 GB | fits | 11.6 GB |
| RTX 4060 Ti 16 GB | fits | 15.4 GB |
| RTX 3090 24 GB | fits | 23.4 GB |
| RTX 4090 24 GB | fits | 23.4 GB |
| RTX 5090 32 GB | fits | 31.0 GB |
| L40S 48 GB | fits | 44.0 GB |
| A100 80 GB | fits | 78.2 GB |
| H100 80 GB | fits | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | fits | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | fits | 107 GB |
| H200 141 GB | fits | 138 GB |
| B200 180 GB | fits | 176 GB |
From the model card
VGen is an open-source video synthesis codebase developed by the Tongyi Lab of Alibaba Group, featuring state-of-the-art video generative models. This repository includes implementations of the following methods:
VGen can produce high-quality videos from the input text, images, desired motion, desired subjects, and even the feedback signals provided. It also offers a variety of commonly used video generation tools such as visualization, sampling, training, inference, join training using images and videos, acceleration, and more.
The main features of VGen are as follows:
conda create -n vgen python=3.8
conda activate vgen
pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu113
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
We have provided a demo dataset that includes images and videos, along with their lists in data.
Please note that the demo images used here are for testing purposes and were not included in the training.
git clone https://github.com/damo-vilab/i2vgen-xl.git
cd i2vgen-xl
Executing the following command to enable distributed training is as easy as that.
python train_net.py --cfg configs/t2v_train.yaml
In the t2v_train.yaml configuration file, you can specify the data, adjust the video-to-image ratio using frame_lens, and validate your ideas with different Diffusion settings, and so on.
grad_scale settings, all of which are included in the Pretrain item in yaml file.workspace/experiments/t2v_traindirectory.After the training is completed, you can perform inference on the model using the following command.
python inference.py --cfg configs/t2v_infer.yaml
Then you can find the videos you generated in the workspace/experiments/test_img_01 directory. For specific configurations such as data, models, seed, etc., please refer to the t2v_infer.yaml file.
(i) Download model and test data:
!pip install modelscope
from modelscope.hub.snapshot_download import snapshot_download
model_dir = snapshot_download('damo/I2VGen-XL', cache_dir='models/', revision='v1.0.0')
(ii) Run the following command:
python inference.py --cfg configs/i2vgen_xl_infer.yaml
In a few minutes, you can retrieve the high-definition video you wish to create from the workspace/experiments/test_img_01 directory. At present, we find that the current model performs inadequately on anime images and images with a black background due to the lack of relevant training data. We are consistently working to optimize it.
In preparation.
Our codebase essentially supports all the commonly used components in video generation. You can manage your experiments flexibly by adding corresponding registration classes, including ENGINE, MODEL, DATASETS, EMBEDDER, AUTO_ENCODER, DISTRIBUTION, VISUAL, DIFFUSION, PRETRAIN, and can be compatible with all our open-source algorithms according to your own needs. If you have any questions, feel free to give us your feedback at any time.
I2VGenXL is supported in the 🧨 diffusers library. Here's how to use it:
import torch
from diffusers import I2VGenXLPipeline
from diffusers.utils import load_image, export_to_gif
repo_id = "ali-vilab/i2vgen-xl"
pipeline = I2VGenXLPipeline.from_pretrained(repo_id, torch_dtype=torch.float16, variant="fp16").to("cuda")
image_url = "https://github.com/ali-vilab/i2vgen-xl/blob/main/data/test_images/img_0009.png?download=tQuoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.
Running it yourself
Rent a machine by the hour. Runs as it is with diffusers, on the machine, in Python.
# on your rented machine: pip install diffusers transformers accelerate ftfy
import torch
from diffusers import DiffusionPipeline
from diffusers.utils import export_to_video
pipe = DiffusionPipeline.from_pretrained("ali-vilab/i2vgen-xl", torch_dtype=torch.bfloat16).to("cuda")
frames = pipe(prompt="a drone shot over a forest at sunrise").frames[0]
export_to_video(frames, "/workspace/out.mp4", fps=16)