MCPcopy Index your code
hub / github.com/Vchitect/SEINE

github.com/Vchitect/SEINE @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
245 symbols 582 edges 15 files 82 documented · 33%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SEINE

arXiv Project Page Replicate Hugging Face Spaces Hits

This repository is the official implementation of SEINE:

SEINE: Short-to-Long Video Diffusion Model for Generative Transition and Prediction (ICLR2024)

SEINE is a video diffusion model and is part of the video generation system Vchitect. You can also check our Text-to-Video (T2V) framework LaVie.

Setup

Prepare Environment

conda create -n seine python==3.9.16
conda activate seine
pip install -r requirement.txt

Download our model and T2I base model

Our model is based on Stable diffusion v1.4, you may download Stable Diffusion v1-4 to the director of pretrained . Download our model checkpoint (from google drive or hugging face) and save to the directory of pretrained

Now under ./pretrained, you should be able to see the following:

├── pretrained
│   ├── seine.pt
│   ├── stable-diffusion-v1-4
│   │   ├── ...
└── └── ├── ...
        ├── ...

Usage

Inference for I2V

Run the following command to get the I2V results:

python sample_scripts/with_mask_sample.py --config configs/sample_i2v.yaml

The generated video will be saved in ./results/i2v.

More Details

You may modify ./configs/sample_i2v.yaml to change the generation conditions. For example:

ckpt is used to specify a model checkpoint.

text_prompt is used to describe the content of the video.

input_path is used to specify the path to the image.

Inference for Transition

python sample_scripts/with_mask_sample.py --config configs/sample_transition.yaml

The generated video will be saved in ./results/transition.

Results

I2V Results

Input Image Output Video

Transition Results

Input Images Output Video

BibTeX

@inproceedings{chen2023seine,
  title={Seine: Short-to-long video diffusion model for generative transition and prediction},
  author={Chen, Xinyuan and Wang, Yaohui and Zhang, Lingjun and Zhuang, Shaobin and Ma, Xin and Yu, Jiashuo and Wang, Yali and Lin, Dahua and Qiao, Yu and Liu, Ziwei},
  booktitle={ICLR},
  year={2023}
}
@article{wang2023lavie,
  title={LAVIE: High-Quality Video Generation with Cascaded Latent Diffusion Models},
  author={Wang, Yaohui and Chen, Xinyuan and Ma, Xin and Zhou, Shangchen and Huang, Ziqi and Wang, Yi and Yang, Ceyuan and He, Yinan and Yu, Jiashuo and Yang, Peiqing and others},
  journal={IJCV},
  year={2024}
}

Disclaimer

We disclaim responsibility for user-generated content. The model was not trained to realistically represent people or events, so using it to generate such content is beyond the model's capabilities. It is prohibited for pornographic, violent and bloody content generation, and to generate content that is demeaning or harmful to people or their environment, culture, religion, etc. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for users' behaviors. Use the generative model responsibly, adhering to ethical and legal standards.

Contact Us

Xinyuan Chen: chenxinyuan@pjlab.org.cn Yaohui Wang: wangyaohui@pjlab.org.cn

Acknowledgements

The code is built upon LaVie, diffusers and Stable Diffusion, we thank all the contributors for open-sourcing.

License

The code is licensed under Apache-2.0, model weights are fully open for academic research and also allow free commercial usage. To apply for a commercial license, please contact vchitect@pjlab.org.cn.

Core symbols most depended-on inside this repo

_extract_into_tensor
called by 23
diffusion/gaussian_diffusion.py
reshape_heads_to_batch_dim
called by 21
models/attention.py
mean_flat
called by 7
diffusion/gaussian_diffusion.py
_is_tensor_video_clip
called by 7
datasets/video_transforms.py
crop
called by 5
datasets/video_transforms.py
q_posterior_mean_variance
called by 4
diffusion/gaussian_diffusion.py
p_mean_variance
called by 4
diffusion/gaussian_diffusion.py
_wrap_model
called by 4
diffusion/respace.py

Shape

Method 136
Function 67
Class 42

Languages

Python100%

Modules by API surface

datasets/video_transforms.py40 symbols
models/attention.py32 symbols
diffusion/gaussian_diffusion.py32 symbols
models/unet_blocks.py27 symbols
models/utils.py19 symbols
utils.py17 symbols
diffusion/timestep_sampler.py15 symbols
models/unet.py14 symbols
models/resnet.py13 symbols
models/clip.py12 symbols
diffusion/respace.py12 symbols
models/__init__.py4 symbols

For agents

$ claude mcp add SEINE \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact