|
1 | 1 | # FancyVideo
|
2 |
| -This is the official reproduction of FancyVideo. |
| 2 | + |
| 3 | +This repository is the official implementation of [FancyVideo](https://360cvgroup.github.io/FancyVideo/). |
| 4 | + |
| 5 | +**[FancyVideo: Towards Dynamic and Consistent Video Generation via Cross-frame Textual Guidance](https://arxiv.org/abs/2408.08189)** |
| 6 | +</br> |
| 7 | +Jiasong Feng*, Ao Ma*, Jing Wang*, Bo Cheng, Xiaodan Liang, Dawei Leng†, Yuhui Yin(*Equal Contribution, ✝Corresponding Author) |
| 8 | +</br> |
| 9 | +[](https://arxiv.org/abs/2408.08189) |
| 10 | +[](https://360cvgroup.github.io/FancyVideo/) |
| 11 | + |
| 12 | +Our code builds upon [AnimateDiff](https://github.com/guoyww/AnimateDiff), and we also incorporate insights from [CV-VAE](https://github.com/AILab-CVC/CV-VAE), [Res-Adapter](https://github.com/bytedance/res-adapter), and [Long-CLIP](https://github.com/beichenzbc/Long-CLIP) to enhance our project. We appreciate the open-source contributions of these works. |
| 13 | + |
| 14 | + |
| 15 | +## 🔥 News |
| 16 | +- **[2024/08/19]** We initialized this github repository and released the inference code and 61-frame model. |
| 17 | +- **[2024/08/15]** We released the paper of [FancyVideo](https://arxiv.org/abs/2408.08189). |
| 18 | + |
| 19 | + |
| 20 | +## Quick Demos |
| 21 | +Video demos can be found in the [webpage](https://360cvgroup.github.io/FancyVideo/). Some of them are contributed by the community. You can customize your own videos using the following reasoning code. |
| 22 | + |
| 23 | + |
| 24 | +## Quick Start |
| 25 | +### 0. Experimental environment |
| 26 | +We tested our inference code on a machine with a 24GB 3090 GPU and CUDA environment version 12.1. |
| 27 | + |
| 28 | +### 1. Setup repository and environment |
| 29 | +``` |
| 30 | +git clone https://github.com/360CVGroup/FancyVideo.git |
| 31 | +cd FancyVideo |
| 32 | +
|
| 33 | +conda create -n fancyvideo python=3.10 |
| 34 | +conda activate fancyvideo |
| 35 | +pip install -r requirements.txt |
| 36 | +``` |
| 37 | + |
| 38 | +### 2. Prepare the models |
| 39 | +``` |
| 40 | +mkdir resources/models |
| 41 | +
|
| 42 | +# fancyvideo-ckpts |
| 43 | +wget -O resources/models/fancyvideo_ckpts.zip "https://drive.google.com/uc?export=download&id=1m4UqKVQ3POI5ei1A9yppHX_H--8PKMtn" |
| 44 | +unzip resources/models/fancyvideo_ckpts.zip |
| 45 | +
|
| 46 | +# cv-vae |
| 47 | +wget -O resources/models/CV-VAE.zip "https://drive.google.com/uc?export=download&id=1Xal1fxVbVWf0jjiPK5gb_1-lOh0w8G_r" |
| 48 | +unzip resources/models/CV-VAE.zip |
| 49 | +
|
| 50 | +# res-adapter |
| 51 | +wget -O resources/models/res-adapter.zip "https://drive.google.com/uc?export=download&id=18EawVd1HJtrQds703sLqoYZtLfbUgLm4" |
| 52 | +unzip resources/models/res-adapter.zip |
| 53 | +
|
| 54 | +# longclip |
| 55 | +wget -O resources/models/LongCLIP-L.zip "https://drive.google.com/uc?export=download&id=1-DDPcbAbmGZJPHsdl1PgFMVtxmOnUtc7" |
| 56 | +unzip resources/models/LongCLIP-L.zip |
| 57 | +
|
| 58 | +# sdv1.5-base-models(you can also donwload from civitai.com) |
| 59 | +wget -O resources/models/sd_v1-5_base_models.zip "https://drive.google.com/uc?export=download&id=1pxrAVT8OQKyyyW2WgImqEQrectbIpkBH" |
| 60 | +unzip resources/models/sd_v1-5_base_models.zip |
| 61 | +
|
| 62 | +# stable-diffusion-v1-5 |
| 63 | +git lfs install |
| 64 | +git clone https://huggingface.co/runwayml/stable-diffusion-v1-5 resources/models |
| 65 | +``` |
| 66 | +After download models, your resources folder is like: |
| 67 | +``` |
| 68 | +📦 resouces/ |
| 69 | +├── 📂 models/ |
| 70 | +│ └── 📂 fancyvideo_ckpts/ |
| 71 | +│ └── 📂 CV-VAE/ |
| 72 | +│ └── 📂 res-adapter/ |
| 73 | +│ └── 📂 LongCLIP-L/ |
| 74 | +│ └── 📂 sd_v1-5_base_models/ |
| 75 | +│ └── 📂 stable-diffusion-v1-5/ |
| 76 | +``` |
| 77 | + |
| 78 | +### 3. Customize your own videos |
| 79 | +#### 3.1 Image to Video |
| 80 | +Due to the limited image generation capabilities of the SD1.5 model, we recommend generating the initial frame using a more advanced T2I model, such as SDXL, and then using our model's I2V capabilities to create the video. |
| 81 | +``` |
| 82 | +CUDA_VISIBLE_DEVICES=0 PYTHONPATH=./ python scripts/demo.py --config configs/inference/i2v.yaml |
| 83 | +``` |
| 84 | +#### 3.2 Text to Video with different base models |
| 85 | +Our model features universal T2V capabilities and can be customized with the SD1.5 community base model. |
| 86 | +``` |
| 87 | +# use the base model of pixars |
| 88 | +CUDA_VISIBLE_DEVICES=0 PYTHONPATH=./ python scripts/demo.py --config configs/inference/t2v_pixars.yaml |
| 89 | +
|
| 90 | +# use the base model of realcartoon3d |
| 91 | +CUDA_VISIBLE_DEVICES=0 PYTHONPATH=./ python scripts/demo.py --config configs/inference/t2v_realcartoon3d.yaml |
| 92 | +
|
| 93 | +# use the base model of toonyou |
| 94 | +CUDA_VISIBLE_DEVICES=0 PYTHONPATH=./ python scripts/demo.py --config configs/inference/t2v_toonyou.yaml |
| 95 | +``` |
| 96 | + |
| 97 | + |
| 98 | +## Reference |
| 99 | +- Animatediff: https://github.com/guoyww/AnimateDiff |
| 100 | +- CV-VAE: https://github.com/AILab-CVC/CV-VAE |
| 101 | +- Animatediff: https://github.com/bytedance/res-adapter |
| 102 | +- Animatediff: https://github.com/beichenzbc/Long-CLIP |
| 103 | + |
| 104 | + |
| 105 | +## We Are Hiring |
| 106 | +We are seeking academic interns in the AIGC field. If interested, please send your resume to [[email protected]](mailto:[email protected]). |
| 107 | + |
| 108 | + |
| 109 | +## BibTeX |
| 110 | +``` |
| 111 | +@misc{feng2024fancyvideodynamicconsistentvideo, |
| 112 | + title={FancyVideo: Towards Dynamic and Consistent Video Generation via Cross-frame Textual Guidance}, |
| 113 | + author={Jiasong Feng and Ao Ma and Jing Wang and Bo Cheng and Xiaodan Liang and Dawei Leng and Yuhui Yin}, |
| 114 | + year={2024}, |
| 115 | + eprint={2408.08189}, |
| 116 | + archivePrefix={arXiv}, |
| 117 | + primaryClass={cs.CV}, |
| 118 | + url={https://arxiv.org/abs/2408.08189}, |
| 119 | +} |
| 120 | +``` |
| 121 | + |
| 122 | + |
| 123 | +## License |
| 124 | +This project is licensed under the [Apache License (Version 2.0)](https://github.com/modelscope/modelscope/blob/master/LICENSE). |
0 commit comments