Commit 3b804999 authored by chenzk's avatar chenzk
Browse files

v1.0

parents
Pipeline #2420 failed with stages
in 0 seconds
exclude: ^tests/data/
repos:
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/PyCQA/isort
rev: 5.11.5
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.32.0
hooks:
- id: yapf
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: double-quote-string-fixer
- id: check-merge-conflict
- id: fix-encoding-pragma
args: ["--remove"]
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.1
hooks:
- id: codespell
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.9
hooks:
- id: mdformat
args: ["--number"]
additional_dependencies:
- mdformat-openmmlab
- mdformat_frontmatter
- linkify-it-py
- repo: https://github.com/asottile/pyupgrade
rev: v3.0.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]
\ No newline at end of file
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2024 CogVideo Model Team @ Zhipu AI
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
The CogVideoX License
1. Definitions
“Licensor” means the CogVideoX Model Team that distributes its Software.
“Software” means the CogVideoX model parameters made available under this license.
2. License Grant
Under the terms and conditions of this license, the licensor hereby grants you a non-exclusive, worldwide, non-transferable, non-sublicensable, revocable, royalty-free copyright license. The intellectual property rights of the generated content belong to the user to the extent permitted by applicable local laws.
This license allows you to freely use all open-source models in this repository for academic research. Users who wish to use the models for commercial purposes must register and obtain a basic commercial license in https://open.bigmodel.cn/mla/form .
Users who have registered and obtained the basic commercial license can use the models for commercial activities for free, but must comply with all terms and conditions of this license. Additionally, the number of service users (visits) for your commercial activities must not exceed 1 million visits per month.
If the number of service users (visits) for your commercial activities exceeds 1 million visits per month, you need to contact our business team to obtain more commercial licenses.
The above copyright statement and this license statement should be included in all copies or significant portions of this software.
3. Restriction
You will not use, copy, modify, merge, publish, distribute, reproduce, or create derivative works of the Software, in whole or in part, for any military, or illegal purposes.
You will not use the Software for any act that may undermine China's national security and national unity, harm the public interest of society, or infringe upon the rights and interests of human beings.
4. Disclaimer
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5. Limitation of Liability
EXCEPT TO THE EXTENT PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER BASED IN TORT, NEGLIGENCE, CONTRACT, LIABILITY, OR OTHERWISE WILL ANY LICENSOR BE LIABLE TO YOU FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES, OR ANY OTHER COMMERCIAL LOSSES, EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
6. Dispute Resolution
This license shall be governed and construed in accordance with the laws of People’s Republic of China. Any dispute arising from or in connection with this License shall be submitted to Haidian District People's Court in Beijing.
Note that the license is subject to update to a more comprehensive version. For any questions related to the license and copyright, please contact us at license@zhipuai.cn.
1. 定义
“许可方”是指分发其软件的 CogVideoX 模型团队。
“软件”是指根据本许可提供的 CogVideoX 模型参数。
2. 许可授予
根据本许可的条款和条件,许可方特此授予您非排他性、全球性、不可转让、不可再许可、可撤销、免版税的版权许可。生成内容的知识产权所属,可根据适用当地法律的规定,在法律允许的范围内由用户享有生成内容的知识产权或其他权利。
本许可允许您免费使用本仓库中的所有开源模型进行学术研究。对于希望将模型用于商业目的的用户,需在 https://open.bigmodel.cn/mla/form 完成登记并获得基础商用授权。
经过登记并获得基础商用授权的用户可以免费使用本模型进行商业活动,但必须遵守本许可的所有条款和条件。
在本许可证下,您的商业活动的服务用户数量(访问量)不得超过100万人次访问 / 每月。如果超过,您需要与我们的商业团队联系以获得更多的商业许可。
上述版权声明和本许可声明应包含在本软件的所有副本或重要部分中。
3.限制
您不得出于任何军事或非法目的使用、复制、修改、合并、发布、分发、复制或创建本软件的全部或部分衍生作品。
您不得利用本软件从事任何危害国家安全和国家统一、危害社会公共利益、侵犯人身权益的行为。
4.免责声明
本软件“按原样”提供,不提供任何明示或暗示的保证,包括但不限于对适销性、特定用途的适用性和非侵权性的保证。
在任何情况下,作者或版权持有人均不对任何索赔、损害或其他责任负责,无论是在合同诉讼、侵权行为还是其他方面,由软件或软件的使用或其他交易引起、由软件引起或与之相关 软件。
5. 责任限制
除适用法律禁止的范围外,在任何情况下且根据任何法律理论,无论是基于侵权行为、疏忽、合同、责任或其他原因,任何许可方均不对您承担任何直接、间接、特殊、偶然、示范性、 或间接损害,或任何其他商业损失,即使许可人已被告知此类损害的可能性。
6.争议解决
本许可受中华人民共和国法律管辖并按其解释。 因本许可引起的或与本许可有关的任何争议应提交北京市海淀区人民法院。
请注意,许可证可能会更新到更全面的版本。 有关许可和版权的任何问题,请通过 license@zhipuai.cn 与我们联系。
# FlashVideo
字节提出FlashVideo,高保真的高分辨率视频生成更快更强。
## 论文
`FlashVideo:Flowing Fidelity to Detail for Efficient High-Resolution Video Generation`
- https://arxiv.org/pdf/2502.05179
## 模型结构
FlashVideo采用级联范式,由低分辨率(即阶段 I)的50亿参数DiT和高分辨率(即阶段II)的20亿参数DiT组成。在两个阶段都采用3D RoPE来有效建模全局和相对时空距离。
<div align=center>
<img src="./doc/structure.png"/>
</div>
## 算法原理
两阶段框架:分别优化了提示保真度和视觉质量。在第一阶段,FlashVideo优先考虑低分辨率下的保真度,利用较大的参数和足够的NFE;第二阶段则在低分辨率和高分辨率之间进行流匹配,利用较少的NFE有效生成细节。
<div align=center>
<img src="./doc/algorithm.png"/>
</div>
## 环境配置
```
mv FlashVideo_pytorch FlashVideo # 去框架名后缀
```
### Docker(方法一)
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.3.0-py3.10-dtk24.04.3-ubuntu20.04
# <your IMAGE ID>为以上拉取的docker的镜像ID替换,本镜像为:b272aae8ec72
docker run -it --shm-size=64G -v $PWD/FlashVideo:/home/FlashVideo -v /opt/hyhal:/opt/hyhal:ro --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name fv <your IMAGE ID> bash
cd /home/FlashVideo
pip install -r requirements.txt
```
### Dockerfile(方法二)
```
cd /home/FlashVideo/docker
docker build --no-cache -t fv:latest .
docker run --shm-size=64G --name fs -v /opt/hyhal:/opt/hyhal:ro --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video -v $PWD/../../FlashVideo:/home/FlashVideo -it fv bash
# 若遇到Dockerfile启动的方式安装环境需要长时间等待,可注释掉里面的pip安装,启动容器后再安装python库:pip install -r requirements.txt。
```
### Anaconda(方法三)
1、关于本项目DCU显卡所需的特殊深度学习库可从光合开发者社区下载安装:
- https://developer.hpccube.com/tool/
```
DTK驱动:dtk24.04.3
python:python3.10
torch:2.3.0
torchvision:0.18.1
torchaudio:2.1.2
triton:2.1.0
vllm:0.6.2
flash-attn:2.6.1
deepspeed:0.14.2
apex:1.3.0
xformers:0.0.25
transformers:4.48.0
```
`Tips:以上dtk驱动、python、torch等DCU相关工具版本需要严格一一对应。`
2、其它非特殊库参照requirements.txt安装
```
cd /home/FlashVideo
sh apt.sh # 安装linux中关于音频需要的基本库,以Ubuntu为例。
pip install -r requirements.txt
```
## 数据集
`无`
## 训练
`无`
## 推理
### 单机多卡
修改torchvision解决torchvision与av库冲突bug。
```
vim /usr/local/lib/python3.10/site-packages/torchvision/io/video.py, line 132:
# frame.pict_type = "NONE"
try:
frame.pict_type = "NONE"
except TypeError:
frame.pict_type = 0 # Use the correct integer value
```
由于FlashVideo的显存占用过大(>=80Gb/GPU,源作者仍在优化效果和性能。),为了能在小算力设备试验,本项目已做两处修改:
```
1、调整显卡数量:
vim inf_270_1080p.sh
--nproc_per_node=4
2、按比例调低第二阶段的生成分辨率:
vim flashvideo/dist_inf_text_file.py
second_img_size = [270, 480]
# 用户未来具备大显存的卡后,还原以上参数即可:nproc_per_node=8、second_img_size = [1080, 1920]
```
```
# 预训练权重目录结构
/home/FlashVideo/checkpoints/
├── 3d-vae.pt
├── stage1.pt
└── stage2.pt
```
```
cd /home/FlashVideo
sh inf_270_1080p.sh
```
更多资料可参考源项目的[`README_origin`](./README_origin.md)
## result
`输入: `
```
input-file: example.txt
```
`输出:`
```
output-dir: vis_270p_1080p_example
```
注:本项目基于1080p数据训练,故分辨率为1080p才能达到目标效果。
源作者提供的效果示例:
<div align=center>
<img src="./doc/output.gif"/>
</div>
### 精度
DCU与GPU精度一致,推理框架:pytorch。
## 应用场景
### 算法类别
`图像超分`
### 热点应用行业
`广媒,影视,动漫,医疗,家居,教育`
## 预训练权重
预训练权重快速下载中心:[SCNet AIModels](http://113.200.138.88:18080/aimodels) ,项目中的预训练权重可从快速下载通道下载:[FlashVideo](http://113.200.138.88:18080/aimodels/foundationvision/FlashVideo.git)[google/t5-v1_1-xxl](http://113.200.138.88:18080/aimodels/google/t5-v1_1-xxl.git)
Hugging Face下载地址为:[FlashVideo](https://huggingface.co/FoundationVision/FlashVideo)[google/t5-v1_1-xxl](https://huggingface.co/google/t5-v1_1-xxl)
## 源码仓库及问题反馈
- http://developer.sourcefind.cn/codes/modelzoo/FlashVideo_pytorch.git
## 参考资料
- https://github.com/FoundationVision/FlashVideo.git
<p align="center">
<img src="figs/logo.png" width="30%", style="vertical-align: middle; margin-right: 0px; position: relative; top: 25px;"> <br>
</p>
<div align="center">
# Flowing Fidelity to Detail for Efficient High-Resolution Video Generation
[![arXiv](https://img.shields.io/badge/arXiv%20paper-2502.05179-b31b1b.svg)](https://arxiv.org/abs/2502.05179)
[![project page](https://img.shields.io/badge/Project_page-More_visualizations-green)](https://jshilong.github.io/flashvideo-page/)&#160;
</div>
<div>
<p align="center">
<img src="figs/methodv3.png" width=90%>
<p>
> [**FlashVideo:Flowing Fidelity to Detail for Efficient High-Resolution Video Generation**](https://arxiv.org/abs/)<br>
> [Shilong Zhang](https://jshilong.github.io/), [Wenbo Li](https://scholar.google.com/citations?user=foGn_TIAAAAJ&hl=en), [Shoufa Chen](https://www.shoufachen.com/), [Chongjian Ge](https://chongjiange.github.io/), [Peize Sun](https://peizesun.github.io/), <br>[Yida Zhang](<>), [Yi Jiang](https://enjoyyi.github.io/), [Zehuan Yuan](https://shallowyuan.github.io/), [Bingyue Peng](<>), [Ping Luo](http://luoping.me/),
> <br>HKU, CUHK, ByteDance<br>
## 🤗 More video examples 👀 can be accessed at the [![project page](https://img.shields.io/badge/Project_page-More_visualizations-green)](https://jshilong.github.io/flashvideo-page/)
<!-- <p align="center">
<img src="figs/pipeline.png" width="50%", style="vertical-align: middle; margin-right: 0px; position: relative; top: 0px;"> <br>
</p> -->
#### <span style="color:blue">⚡⚡</span> User Prompt to <span style="color:green">270p</span>, NFE = 50, Takes ~30s <span style="color:blue">⚡⚡
#### ⚡⚡</span> <span style="color:green">270p</span> to <span style="color:purple">1080p</span> , NFE = 4, Takes ~72s <span style="color:blue">⚡⚡</span>
[![]()](https://github.com/FoundationVision/flashvideo-page/blob/main/static/images/output.gif)
<!-- <p align="center">
<img src="https://github.com/FoundationVision/flashvideo-page/blob/main/static/images/output.gif" width="80%", style="vertical-align: middle; margin-right: 0px; position: relative; top: 25px;"> <br>
</p> -->
<p align="center">
<img src="https://github.com/FoundationVision/flashvideo-page/blob/main/static/images/output.gif" width="100%"> <br>
</p>
<!-- <video id="video1" width="960" height="270" controls poster="figs/22_0.jpg">
<source src="https://github.com/FoundationVision/flashvideo-page/raw/refs/heads/main/static/githubfigs/270_1080/22_0.mp4" type="video/mp4">
Your browser does not support the video tag.
</video> -->
## 🔥 Update
- \[2025.02.10\] 🔥 🔥 🔥 Inference code and both stage model [weights](https://huggingface.co/FoundationVision/FlashVideo/tree/main) have been released.
## 🌿 Introduction
In this repository, we provide:
- [x] The stage-I weight for 270P video generation.
- [x] The stage-II for enhancing 270P video to 1080P.
- [x] Inference code of both stages.
- [ ] Training code and related augmentation.
- [ ] Implementation with diffusers.
## Install
### 1. Environment Setup
This repository is tested with PyTorch 2.4.0+cu121 and Python 3.11.11. You can install the necessary dependencies using the following command:
```shell
pip install -r requirements.txt
```
### 2. Preparing the Checkpoints
To get the 3D VAE (identical to CogVideoX), along with Stage-I and Stage-II weights, set them up as follows:
```shell
cd FlashVideo
mkdir -p ./checkpoints
huggingface-cli download --local-dir ./checkpoints FoundationVision/FlashVideo
```
The checkpoints should be organized as shown below:
```
├── 3d-vae.pt
├── stage1.pt
└── stage2.pt
```
## 🚀 Text to Video Generation
#### ⚠️ IMPORTANT NOTICE ⚠️ : Both stage-I and stage-II are trained with long prompts only. For achieving the best results, include comprehensive and detailed descriptions in your prompts, akin to the example provided in [example.txt](./example.txt).
### Jupyter Notebook
You can conveniently provide user prompts in our Jupyter notebook. The default configuration for spatial and temporal slices in the VAE Decoder is tailored for an 80G GPU. For GPUs with less memory, one might consider increasing the [spatial and temporal slice](https://github.com/FoundationVision/FlashVideo/blob/400a9c1ef905eab3a1cb6b9f5a5a4c331378e4b5/sat/utils.py#L110).
```python
flashvideo/demo.ipynb
```
### Inferring from a Text File Containing Prompts
You can conveniently provide the user prompt in a text file and generate videos with multiple gpus.
```python
bash inf_270_1080p.sh
```
## License
This project is developed based on [CogVideoX](https://github.com/THUDM/CogVideo). Please refer to their original [license](https://github.com/THUDM/CogVideo?tab=readme-ov-file#model-license) for usage details.
## BibTeX
```bibtex
@article{zhang2025flashvideo,
title={FlashVideo:Flowing Fidelity to Detail for Efficient High-Resolution Video Generation},
author={Zhang, Shilong and Li, Wenbo and Chen, Shoufa and Ge, Chongjian and Sun, Peize and Zhang, Yida and Jiang, Yi and Yuan, Zehuan and Binyue, Peng and Luo, Ping},
journal={arXiv preprint arXiv:2502.05179},
year={2025}
}
```
---
license: mit
---
This image diff could not be displayed because it is too large. You can view the blob instead.
FROM image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.3.0-py3.10-dtk24.04.3-ubuntu20.04
ENV DEBIAN_FRONTEND=noninteractive
# RUN yum update && yum install -y git cmake wget build-essential
# RUN source /opt/dtk-24.04.3/env.sh
# # 安装pip相关依赖
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
accelerate>=0.33.0 #git+https://github.com/huggingface/accelerate.git@main#egg=accelerate is suggested
diffusers>=0.30.1 #git+https://github.com/huggingface/diffusers.git@main#egg=diffusers is suggested
gradio>=4.42.0 # For HF gradio demo
imageio==2.34.2 # For diffusers inference export video
imageio-ffmpeg==0.5.1 # For diffusers inference export video
moviepy==1.0.3 # For export video
numpy==1.26.0
openai>=1.42.0 # For prompt refiner
pillow==9.5.0
sentencepiece>=0.2.0 # T5 used
streamlit>=1.38.0 # For streamlit web demo
SwissArmyTransformer>=0.4.12
# torch>=2.4.0 # Tested in 2.2 2.3 2.4 and 2.5, The development team is working on version 2.4.0.
# torchvision>=0.19.0 # The development team is working on version 0.19.0.
transformers>=4.44.2 # The development team is working on version 4.44.2
omegaconf==2.3.0
pytorch_lightning==2.5.0.post0
kornia==0.8.0
scipy==1.15.1
torchdiffeq==0.2.5
beartype==0.19.0
PyAV==14.1.0
av==14.1.0
wandb
The video begins with a view of a cozy log cabin nestled among lush trees in a dense forest. A gentle plume of white smoke rises gracefully from the chimney, curling against the backdrop of towering pines. The windows emit a warm, soft glow, hinting at a comforting and inviting atmosphere within. The camera slowly pans from right to left, capturing the serene setting and emphasizing the harmony between the cabin and its natural surroundings.
A stylish woman strides confidently down a bustling Tokyo street, which is illuminated by warm glowing neon and animated city signage. She exudes elegance in a black leather jacket, a long red dress flowing gracefully as she moves, and chic black boots, while a black purse swings at her side. Her striking red lipstick complements her sleek sunglasses, enhancing her sophisticated look. Her casual yet assured walk creates an air of confidence. The damp street beneath her feet glistens, reflecting the vibrant array of colorful lights above. The camera follows her fluid motion, capturing the mirror-like effect on the ground and the dynamic hustle around her with pedestrians weaving through the luminous scene.
A beautiful princess with elegantly styled hair and a flowing gown rides gracefully on a majestic horse as she crosses a gently flowing river. The horse moves steadily through the water, creating ripples that shimmer under the soft sunlight. The princess holds the reins with a gentle, yet confident grip, her expression serene and focused. The camera starts with a wide view of the river and approaches the princess as she nears the riverbank, capturing the water's movement and her poised demeanor.
In a cozy cafe bathed in warm, ambient lighting, a fluffy llama with a cream-colored coat is seated at a wooden table. Wearing a pair of stylish round glasses perched on its snout, the llama intently focuses on the laptop screen, which glows with a soft blue light. Its hooves move delicately across the keyboard, typing codes with surprising dexterity. The camera gently sweeps around the table, capturing the concentration visible in the llama's large, expressive eyes, and revealing the inviting atmosphere of the cafe, complete with rustic decor and other patrons in the background.
A drone camera gracefully circles around a stunning historic church perched on a rocky outcropping along the Amalfi Coast, offering a sweeping view of the church's intricate architectural details and tiered pathways. The scene captures waves crashing against the rocks below while overlooking the endless horizon of coastal waters and the hilly landscapes of the Amalfi Coast, Italy. In the distance, people are visible walking and enjoying the breathtaking ocean vistas from the patios. The warm glow of the afternoon sun bathes the scene, enhancing the magical and romantic atmosphere. The entire view is beautifully captured with precise and stunning videography.
In a tranquil forest clearing, a sparkling waterfall cascades down gracefully into a clear pool, its shimmering water reflecting the vibrant colors of the surrounding scene. The lush greenery frames the waterfall, with an array of colorful flowers adding bursts of red, yellow, and blue throughout the landscape. Occasionally, small birds with bright plumage flutter delicately past, their movement adding life to the serene setting. The camera gently pans from the top of the waterfall, following the flow of water and capturing the surrounding flora in a sweeping motion, enhancing the peaceful atmosphere of the scene.
A sleek, curious cat with bright green eyes peers out from a cozy hiding spot, its soft fur gleaming in the gentle light. The cat's ears are perked up, attentive to every sound, while its whiskers twitch slightly. The camera moves slowly, capturing the cat's face from a side angle, highlighting its inquisitive expression as it cautiously scans its surroundings. The cozy spot is bathed in warm, soft lighting, adding to the inviting atmosphere of the scene.
A chubby red panda with soft, russet fur and striking dark eye patches is sitting atop a wooden platform. Its fluffy tail is curled around its side, adding to its charming appearance. The red panda holds a slice of pizza in its small, dexterous paws, sniffing it briefly before taking a delicate bite. As it nibbles on the pizza, the panda's ears twitch slightly. The camera slowly zooms in to capture the adorable moment, focusing on the panda's gentle expression and the playful way it handles the pizza slice. The background features lush green foliage, adding a natural contrast to the scene.
Several giant wooly mammoths move gracefully through a snowy meadow, their long, thick woolly fur gently billowing in the wind with each step. Snow-covered trees and dramatic snow-capped mountains provide a picturesque backdrop. The scene is bathed in mid-afternoon light with wispy clouds and a sun high in the sky, casting a warm glow over the landscape. The low camera angle stunningly captures the majestic creatures in exquisite detail, with a rich depth of field highlighting their impressive size and texture against the serene environment.
A crab artfully crafted from a variety of jewelry pieces, including shiny diamonds and lustrous pearls, is elegantly walking along the beach. Its shell glistens in the sunlight, exhibiting an array of sparkling gems such as sapphires and rubies. As the crab moves gracefully across the sandy shore, with its legs glinting like precious metal, it intermittently drops jewelry pieces, leaving a trail of shimmering treasures behind. The camera smoothly follows the crab's journey, capturing the vibrant jewelry against the contrasting sandy background, accentuating the exquisite beauty of this unique creature as it continues its delightful path along the beach.
The video captures an adorable kitten dressed in a miniature pirate costume, complete with a small hat and a striped vest. The kitten sits confidently atop a robot vacuum, riding it around the house. The vacuum moves smoothly across the floor, navigating around furniture. The camera follows the kitten's playful journey, capturing its curious expression as it sways gently with the vacuum's motion. The lighting in the room is warm and inviting, highlighting the kitten's soft fur and mischievous demeanor.
A serene lakeside cabin with rustic wooden beams and a cozy porch sits peacefully by the water's edge. The cabin is surrounded by lush greenery and reflects tranquility. A wooden dock extends into the lake, and at the end of the dock, a small rowboat features a classic wooden design. The rowboat gently bobs up and down with the rhythmic movement of the water, creating soft ripples across the lake's surface. The camera slowly pans from the cabin to the rowboat, capturing the serene atmosphere and the gentle interactions between the boat and the water.
In a tranquil forest clearing, a sparkling waterfall cascades down gracefully into a clear pool, its shimmering water reflecting the vibrant colors of the surrounding scene. The lush greenery frames the waterfall, with an array of colorful flowers adding bursts of red, yellow, and blue throughout the landscape. Occasionally, small birds with bright plumage flutter delicately past, their movement adding life to the serene setting. The camera gently pans from the top of the waterfall, following the flow of water and capturing the surrounding flora in a sweeping motion, enhancing the peaceful atmosphere of the scene.
A cow with a glossy coat lounges on a beach chair beneath a swaying palm tree, sporting stylish sunglasses and a straw hat. The cow appears relaxed, with its head slightly tilted and ears perked up, showcasing a playful demeanor. The camera gently zooms in to capture the cow's curious expression, highlighting the contrast of its cool accessories against the vibrant beach setting. The scene is bathed in warm sunlight, enhancing the relaxed and tropical atmosphere.
The camera begins with a close-up of a pedestal situated at the edge of a canyon, slowly moving upward. As the camera ascends, the expansive canyon landscape becomes visible, showcasing its rugged, rocky terrain. The majestic river below gradually comes into view, winding gracefully through the canyon. The movement reveals the vastness of the natural scenery, with the sun casting a warm glow over the breathtaking vista.
The camera smoothly pushes in through an ornate garden archway, delicately adorned with climbing ivy. Beyond the archway, a secret, tranquil garden is revealed, brimming with a vibrant array of blooming flowers in a myriad of colors. The lush garden comes into full view as the camera continues to move forward, capturing the peaceful atmosphere and the gentle rustling of leaves in the soft breeze. The scene is bathed in natural sunlight, highlighting the vivid hues of the flowers and the verdant greenery, creating a serene and inviting environment.
The camera gently glides through a beautiful garden to reveal an ancient fountain nestled among vibrant flowers and lush greenery. The fountain, made of weathered stone with intricate carvings, softly trickles water that cascades down its sides. Surrounding the fountain are colorful flowers in full bloom, with hues of red, yellow, and pink. Tall, verdant plants sway gently in the breeze, their leaves glistening under the sunlight. The camera captures the enchanting atmosphere, as if the garden whispers secrets of a long-forgotten past.
The video begins from a first-person point of view as the camera smoothly moves through the frozen streets of Manhattan, New York City. The streets are lined with trees, their branches heavy with ice, glistening in the cold light. The camera's movement continues to reveal the iconic Empire State Building, its facade completely encased in shimmering frost. The structure towers majestically above, its silhouette etched against a wintry sky. The camera maintains a steady pace, capturing the serene yet haunting beauty of the frozen metropolis.
A fluffy llama with soft, white fur rests comfortably in a cozy reading nook, nestled among an array of plush pillows and soft blankets. The llama's large, gentle eyes are focused intently on the picture book in front of it. Warm, golden lighting from a nearby floor lamp bathes the scene, creating a welcoming and serene atmosphere. As the llama reads the picture book aloud, it uses expressive voices for the characters, its mouth and eyes animated with enthusiasm. The camera smoothly pans in to capture the llama's engaging expressions and the vibrant illustrations on the book's pages, offering a close-up view that enhances the storytelling experience.
A drone camera gracefully circles around a stunning historic church perched on a rocky outcropping along the Amalfi Coast, offering a sweeping view of the church's intricate architectural details and tiered pathways. The scene captures waves crashing against the rocks below while overlooking the endless horizon of coastal waters and the hilly landscapes of the Amalfi Coast, Italy. In the distance, people are visible walking and enjoying the breathtaking ocean vistas from the patios. The warm glow of the afternoon sun bathes the scene, enhancing the magical and romantic atmosphere. The entire view is beautifully captured with precise and stunning videography.
An extreme close-up captures a gray-haired man with a well-groomed beard in his 60s, exuding a sense of wisdom and thoughtfulness. His deep-set eyes, framed by glasses, focus intently on unseen people passing by, as he sits mostly still at a Parisian café. The man's attire includes a distinguished wool coat suit and a crisp button-down shirt, complemented by a brown beret that enhances his professorial appearance. In the cinematic lighting, a warm golden glow envelops him, adding depth to the scene, with the iconic streets of Paris softly blurred in the background. His expression subtly shifts to a closed-mouth smile, suggesting a moment of revelation. The camera, capturing this in 35mm, gently moves slightly to the side, enhancing the scene's depth and immersing the viewer in his reflective moment.
The video opens with a sweeping aerial shot of the Glenfinnan Viaduct, a historic railway bridge in Scotland, UK, gracefully spanning the west highland line between the towns of Mallaig and Fort William. A steam train, with its vintage carriages and sleek black engine, travels smoothly over the arch-covered viaduct, emitting trails of white steam into the clear blue sky. The camera captures the train from a side view, highlighting the rhythmic movement of the wheels. The surrounding landscape is adorned with lush greenery and rugged rocky mountains, creating a picturesque backdrop for the train's journey. The camera pans to track the train as it crosses the bridge, with sunlight reflecting off the metal tracks, enhancing the beauty of this majestic scene.
A white and orange tabby cat, with strikingly vibrant fur, is seen joyfully darting through a dense garden, its eyes wide and gleaming with excitement. The cat jogs forward with spirited agility, its gaze scanning the surrounding branches, flowers, and leaves as it navigates the narrow path between the lush plant life. The camera captures the scene from a ground-level angle, closely following the cat to provide a low and intimate perspective. The image is enhanced with cinematic warm tones and a subtle grainy texture, while the scattered daylight filtering through the leaves above creates a beautiful contrast that accentuates the cat’s orange fur. The shot remains clear and sharp, utilizing a shallow depth of field to emphasize the feline's graceful movements amidst the vibrant greenery.
A fluffy white cat with captivating blue eyes is sitting in the driver’s seat of a car, its small paws gripping the steering wheel as it looks ahead with an alert expression. The car moves slowly through a busy downtown street, surrounded by tall buildings that tower into the sky. The bustling city environment is alive with pedestrians walking along the sidewalks. The camera captures the scene from the front of the car, initially showing a view of the cat's determined face and the sleek interior of the car. It then smoothly shifts to show the busy street scene outside, with the cat visible through the windshield against the backdrop of the lively cityscape, adding a whimsical and engaging atmosphere to the video.
A charming rabbit with soft, fluffy fur and long ears is sitting on a quaint wooden chair, holding a newspaper. The rabbit is wearing round, wire-rimmed glasses perched delicately on its nose, giving it an intellectual appearance. The rabbit's paws gently hold the edges of the newspaper as its eyes scan the text. The camera starts with a close-up shot of the rabbit's expressive face, capturing the reflection in the glasses, then shifts to display the rabbit's full frame, highlighting its attentive posture as it sits engrossed in reading.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment