Skip to content

Open-Sora: Democratizing Efficient Video Production for All

Python

[wip] human evaluation

zhengzangw43fa324a6e90
diff --git a/README.md b/README.md
index ae19ad8..7575047 100644
--- a/README.md
+++ b/README.md
@@ -24,8 +24,9 @@ With Open-Sora, our goal is to foster innovation, creativity, and inclusivity wi
## πŸ“° News
+* **[2024.06.17]** πŸ”₯ We released **Open-Sora 1.2**, which includes **3D-VAE** and **rectified flow**. The video quality is greatly improved.
* **[2024.04.25]** πŸ€— We released the [Gradio demo for Open-Sora](https://huggingface.co/spaces/hpcai-tech/open-sora) on Hugging Face Spaces.
-* **[2024.04.25]** πŸ”₯ We released **Open-Sora 1.1**, which supports **2s~15s, 144p to 720p, any aspect ratio** text-to-image, **text-to-video, image-to-video, video-to-video, infinite time** generation. In addition, a full video processing pipeline is released. [[checkpoints]]() [[report]](/docs/report_02.md)
+* **[2024.04.25]** We released **Open-Sora 1.1**, which supports **2s~15s, 144p to 720p, any aspect ratio** text-to-image, **text-to-video, image-to-video, video-to-video, infinite time** generation. In addition, a full video processing pipeline is released. [[checkpoints]]() [[report]](/docs/report_02.md)
* **[2024.03.18]** We released **Open-Sora 1.0**, a fully open-source project for video generation.
Open-Sora 1.0 supports a full pipeline of video data preprocessing, training with
<a href="https://github.com/hpcaitech/ColossalAI"><img src="assets/readme/colossal_ai.png" width="8%" ></a>
@@ -39,6 +40,9 @@ With Open-Sora, our goal is to foster innovation, creativity, and inclusivity wi
πŸ”₯ You can experience Open-Sora on our [πŸ€— Gradio application on Hugging Face](https://huggingface.co/spaces/hpcai-tech/open-sora). More samples are available in our [Gallery](https://hpcaitech.github.io/Open-Sora/).
+<details>
+<summary>OpenSora 1.1 Demo</summary>
+
| **2s 240Γ—426** | **2s 240Γ—426** |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [<img src="assets/demo/sample_16x240x426_9.gif" width="">](https://github.com/hpcaitech/Open-Sora-dev/assets/99191637/c31ebc52-de39-4a4e-9b1e-9211d45e05b2) | [<img src="assets/demo/sora_16x240x426_26.gif" width="">](https://github.com/hpcaitech/Open-Sora-dev/assets/99191637/c31ebc52-de39-4a4e-9b1e-9211d45e05b2) |
@@ -52,6 +56,8 @@ With Open-Sora, our goal is to foster innovation, creativity, and inclusivity wi
| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [<img src="assets/demo/sample_16s_320x320.gif" width="">](https://github.com/hpcaitech/Open-Sora/assets/99191637/3cab536e-9b43-4b33-8da8-a0f9cf842ff2) | [<img src="assets/demo/sample_16s_224x448.gif" width="">](https://github.com/hpcaitech/Open-Sora/assets/99191637/9fb0b9e0-c6f4-4935-b29e-4cac10b373c4) | [<img src="assets/demo/sora_16x426x240_3.gif" width="">](https://github.com/hpcaitech/Open-Sora-dev/assets/99191637/3e892ad2-9543-4049-b005-643a4c1bf3bf) |
+</details>
+
<details>
<summary>OpenSora 1.0 Demo</summary>
@@ -69,7 +75,10 @@ see [here](/assets/texts/t2v_samples.txt) for full prompts.
## πŸ”† New Features/Updates
-* πŸ“ **Open-Sora 1.1** released. Model weights are available [here](). It is trained on **0s~15s, 144p to 720p, various aspect ratios** videos. See our **[report 1.1](docs/report_02.md)** for more discussions.
+* πŸ“ **Open-Sora 1.2** released. Model weights are available [here](#model-weights).
+* βœ… Support rectified flow scheduling.
+* βœ… Trained our 3D-VAE for temporal dimension compression.
+* πŸ“ **Open-Sora 1.1** released. Model weights are available [here](#model-weights). It is trained on **0s~15s, 144p to 720p, various aspect ratios** videos. See our **[report 1.1](docs/report_02.md)** for more discussions.
* πŸ”§ **Data processing pipeline v1.1** is released. An automatic [processing pipeline](#data-processing) from raw videos to (text, video clip) pairs is provided, including scene cutting $\rightarrow$ filtering(aesthetic, optical flow, OCR, etc.) $\rightarrow$ captioning $\rightarrow$ managing. With this tool, you can easily build your video dataset.
* βœ… Improved ST-DiT architecture includes rope positional encoding, qk norm, longer text length, etc.
* βœ… Support training with any resolution, aspect ratio, and duration (including images).
@@ -193,8 +202,19 @@ docker run -ti --gpus all -v {MOUNT_DIR}:/data opensora
## Model Weights
+### Open-Sora 1.2 Model Weights
+
+| Resolution | Model Size | Data | #iterations | Batch Size | URL |
+| ---------- | ---------- | ---- | ----------- | ---------- | --- |
+| TBD |
+
+See our **[report 1.2](docs/report_03.md)** for more infomation.
+
### Open-Sora 1.1 Model Weights
+<details>
+<summary>View more</summary>
+
| Resolution | Model Size | Data | #iterations | Batch Size | URL |
| ------------------ | ---------- | -------------------------- | ----------- | ------------------------------------------------- | -------------------------------------------------------------------- |
| mainly 144p & 240p | 700M | 10M videos + 2M images | 100k | [dynamic](/configs/opensora-v1-1/train/stage2.py) | [:link:](https://huggingface.co/hpcai-tech/OpenSora-STDiT-v2-stage2) |
@@ -204,6 +224,8 @@ See our **[report 1.1](docs/report_02.md)** for more infomation.
:warning: **LIMITATION**: This version contains known issues which we are going to fix in the next version (as we save computation resource for the next release). In addition, the video generation may fail for long duration, and high resolution will have noisy results due to this problem.
+</details>
+
### Open-Sora 1.0 Model Weights
<details>
@@ -352,6 +374,8 @@ If you wish to contribute to this project, please refer to the [Contribution Gui
## Acknowledgement
+Here we only list a few of the projects. For other works and datasets, please refer to our report.
+
* [ColossalAI](https://github.com/hpcaitech/ColossalAI): A powerful large model parallel acceleration and optimization
system.
* [DiT](https://github.com/facebookresearch/DiT): Scalable Diffusion Models with Transformers.
@@ -363,9 +387,23 @@ If you wish to contribute to this project, please refer to the [Contribution Gui
* [CLIP](https://github.com/openai/CLIP): A powerful text-image embedding model.
* [T5](https://github.com/google-research/text-to-text-transfer-transformer): A powerful text encoder.
* [LLaVA](https://github.com/haotian-liu/LLaVA): A powerful image captioning model based on [Mistral-7B](https://huggingface.co/mistralai/Mistral-7B-v0.1) and [Yi-34B](https://huggingface.co/01-ai/Yi-34B).
+* [PLLaVA](https://github.com/magic-research/PLLaVA): A powerful video captioning model.
+* [MiraData](https://github.com/mira-space/MiraData): A large-scale video dataset with long durations and structured caption.
We are grateful for their exceptional work and generous contribution to open source.
+## Citation
+
+```bibtex
+@software{opensora,
+ author = {Zangwei Zheng and Xiangyu Peng and Tianji Yang and Chenhui Shen and Shenggui Li and Hongxin Liu and Yukun Zhou and Tianyi Li and Yang You},
+ title = {Open-Sora: Democratizing Efficient Video Production for All},
+ month = {March},
+ year = {2024},
+ url = {https://github.com/hpcaitech/Open-Sora}
+}
+```
+
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=hpcaitech/Open-Sora&type=Date)](https://star-history.com/#hpcaitech/Open-Sora&Date)
diff --git a/eval/sample.sh b/eval/sample.sh
index d52b667..28e6065 100644
--- a/eval/sample.sh
+++ b/eval/sample.sh
@@ -54,32 +54,42 @@ function run_image() { # 14min
# 1.4 720p multi-resolution
# 1:1
PROMPT="Bright scene, aerial view,ancient city, fantasy, gorgeous light, mirror reflection, high detail, wide angle lens."
- eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 960 960 --sample-name 720p_1_1
+ eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 960 960 --sample-name image_720p_1_1
# 16:9
- eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 720 1280 --sample-name 720p_16_9
+ eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 720 1280 --sample-name image_720p_16_9
# 9:16
- eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 1280 720 --sample-name 720p_9_16
+ eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 1280 720 --sample-name image_720p_9_16
# 4:3
- eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 832 1108 --sample-name 720p_4_3
+ eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 832 1108 --sample-name image_720p_4_3
# 3:4
- eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 1108 832 --sample-name 720p_3_4
+ eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 1108 832 --sample-name image_720p_3_4
# 1:2
- eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 1358 600 --sample-name 720p_1_2
+ eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 1358 600 --sample-name image_720p_1_2
# 2:1
- eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 600 1358 --sample-name 720p_2_1
+ eval $CMD --ckpt-path $CKPT --prompt \"$PROMPT\" --save-dir $OUTPUT --num-frames 1 --image-size 600 1358 --sample-name image_720p_2_1
}
function run_video_a() { # 42min, sample & multi-resolution
# sample
+ # drop
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_samples.txt --save-dir $OUTPUT --num-frames $NUM_FRAMES --image-size 144 256 --sample-name sample_${NUM_FRAMES}x144x256 --batch-size $DEFAULT_BS
+ # keep
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_samples.txt --save-dir $OUTPUT --num-frames $NUM_FRAMES --image-size 240 426 --sample-name sample_${NUM_FRAMES}x240x426 --batch-size $DEFAULT_BS
+ # drop
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_samples.txt --save-dir $OUTPUT --num-frames $DOUBLE_FRAMES --image-size 240 426 --sample-name sample_${DOUBLE_FRAMES}x240x426 --batch-size $DEFAULT_BS
+ # 8x
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_samples.txt --save-dir $OUTPUT --num-frames $QUAD_FRAMES --image-size 240 426 --sample-name sample_${QUAD_FRAMES}x240x426 --batch-size $DEFAULT_BS
+ # keep
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_samples.txt --save-dir $OUTPUT --num-frames $NUM_FRAMES --image-size 480 854 --sample-name sample_${NUM_FRAMES}x480x854 --batch-size $DEFAULT_BS
+ # 4x
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_samples.txt --save-dir $OUTPUT --num-frames $DOUBLE_FRAMES --image-size 480 854 --sample-name sample_${DOUBLE_FRAMES}x480x854 --batch-size $DEFAULT_BS
+ # 2x
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_samples.txt --save-dir $OUTPUT --num-frames $NUM_FRAMES --image-size 720 1280 --sample-name sample_${NUM_FRAMES}x720x1280 --batch-size $DEFAULT_BS
}
+# for (short, sora, sample)
+# for ( (2s, 720p), (8s, 480p), (16s, 240p) )
+
function run_video_b() { # 18min + 14min = 32min, short 16x240p & 64x240p
# run image
echo "Inside run_video_b, running image samples..."
@@ -87,17 +97,21 @@ function run_video_b() { # 18min + 14min = 32min, short 16x240p & 64x240p
echo "Inside run_video_b, running video samples..."
# 32x240p, short
+ # drop
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_short.txt --save-dir $OUTPUT --num-frames $DOUBLE_FRAMES --image-size 240 426 --sample-name short_${DOUBLE_FRAMES}x240x426 --batch-size $DEFAULT_BS
# 64x240p, short
+ # 8x
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_short.txt --save-dir $OUTPUT --num-frames $QUAD_FRAMES --image-size 240 426 --sample-name short_${QUAD_FRAMES}x240x426 --batch-size $DEFAULT_BS
}
function run_video_c() { # 60min, sora 16x240p & short 128x240p
# 16x240p, sora
+ # drop
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_sora.txt --save-dir $OUTPUT --num-frames $NUM_FRAMES --image-size 426 240 --sample-name sora_${NUM_FRAMES}x426x240 --batch-size $DEFAULT_BS
# 16x240p, sora
+ # drop
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_sora.txt --save-dir $OUTPUT --num-frames $NUM_FRAMES --image-size 240 426 --sample-name sora_${NUM_FRAMES}x240x426 --batch-size $DEFAULT_BS
# 128x240p, sora
@@ -106,22 +120,27 @@ function run_video_c() { # 60min, sora 16x240p & short 128x240p
function run_video_d() { # 21min + 30min = 51min, sora 32x480p
# 32x480p, short
+ # -> 8s, 480p
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_short.txt --save-dir $OUTPUT --num-frames $DOUBLE_FRAMES --image-size 480 854 --sample-name short_${DOUBLE_FRAMES}x480x854 --batch-size $DEFAULT_BS
- # 64x480p, sora, moved from run_video_e
+ # + 2s, 720p, short
+
+ # 8s, 480p, sora, moved from run_video_e
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_sora.txt --save-dir $OUTPUT --num-frames $QUAD_FRAMES --image-size 480 854 --sample-name sora_${QUAD_FRAMES}x480x854 --batch-size $DEFAULT_BS --start-index 0 --end-index 16
}
function run_video_e() { # 90min * 2/3 = 60min
- # 64x480p, sora
+ # 8s, 480p, sora
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_sora.txt --save-dir $OUTPUT --num-frames $QUAD_FRAMES --image-size 480 854 --sample-name sora_${QUAD_FRAMES}x480x854 --batch-size $DEFAULT_BS --start-index 16 --end-index 100
}
function run_video_f() { # 60min
- # 16x720p, sora
+ # 2s, 720p, sora
eval $CMD --ckpt-path $CKPT --prompt-path assets/texts/t2v_sora.txt --save-dir $OUTPUT --num-frames $NUM_FRAMES --image-size 720 1280 --sample-name sora_${NUM_FRAMES}x720x1280 --batch-size $DEFAULT_BS
}
+# --resolution 720p --aspect-ratio [16:9, 9:16, ...]
+
function run_video_g() { # 15min
# 16x720p multi-resolution
# 1:1
@@ -164,6 +183,8 @@ function run_video_g() { # 15min
\"A stylish woman walking in the street of Tokyo. aesthetic score: 7.0\"
}
+# resolution -> 480p
+
function run_video_h() { # 61min
# 3.1 image-conditioned long video generation
eval $CMD --ckpt-path $CKPT --save-dir $OUTPUT --sample-name ref_L10C4_${NUM_FRAMES}x240x426 \
diff --git a/opensora/datasets/aspect.py b/opensora/datasets/aspect.py
index f6f6065..5a4aca7 100644
--- a/opensora/datasets/aspect.py
+++ b/opensora/datasets/aspect.py
@@ -475,6 +475,10 @@ NUM_FRAMES_MAP = {
"2x": 102,
"4x": 204,
"8x": 408,
+ "2s": 51,
+ "4s": 102,
+ "8s": 204,
+ "16s": 408,
}