File size: 6,924 Bytes
7f2bd75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Repo Structure

```plaintext
Open-Sora
β”œβ”€β”€ README.md
β”œβ”€β”€ assets
β”‚   β”œβ”€β”€ images                     -> images used for image-conditioned generation
β”‚   β”œβ”€β”€ demo                       -> images used for demo
β”‚   β”œβ”€β”€ texts                      -> prompts used for text-conditioned generation
β”‚   └── readme                     -> images used in README
β”œβ”€β”€ configs                        -> Configs for training & inference
β”œβ”€β”€ docker                         -> dockerfile for Open-Sora
β”œβ”€β”€ docs
β”‚   β”œβ”€β”€ acceleration.md            -> Report on acceleration & speed benchmark
β”‚   β”œβ”€β”€ commands.md                -> Commands for training & inference
β”‚   β”œβ”€β”€ datasets.md                -> Datasets used in this project
|   β”œβ”€β”€ data_processing.md         -> Data pipeline documents
|   β”œβ”€β”€ installation.md            -> Data pipeline documents
β”‚   β”œβ”€β”€ structure.md               -> This file
β”‚   β”œβ”€β”€ config.md                  -> Configs for training and inference
β”‚   β”œβ”€β”€ report_01.md               -> Report for Open-Sora 1.0
β”‚   β”œβ”€β”€ report_02.md               -> Report for Open-Sora 1.1
β”‚   β”œβ”€β”€ report_03.md               -> Report for Open-Sora 1.2
β”‚   β”œβ”€β”€ vae.md                     -> our VAE report
β”‚   └── zh_CN                      -> Chinese version of the above
β”œβ”€β”€ eval                           -> Evaluation scripts
β”‚   β”œβ”€β”€ README.md                  -> Evaluation documentation
|   β”œβ”€β”€ human_eval                 -> for human eval
|   β”œβ”€β”€ launch.sh                  -> script for launching 8 cards sampling
|   β”œβ”€β”€ loss                       -> eval loss
|   β”œβ”€β”€ sample.sh                  -> script for quickly launching inference on predefined prompts
|   β”œβ”€β”€ vae                        -> for vae eval
|   β”œβ”€β”€ vbench                     -> for VBench evaluation
β”‚   └── vbench_i2v                 -> for VBench i2v evaluation
β”œβ”€β”€ gradio                         -> Gradio demo related code
β”œβ”€β”€ notebooks                      -> Jupyter notebooks for generating commands to run
β”œβ”€β”€ scripts
β”‚   β”œβ”€β”€ train.py                   -> diffusion training script
β”‚   β”œβ”€β”€ train_vae.py               -> vae training script
β”‚   β”œβ”€β”€ inference.py               -> diffusion inference script
β”‚   β”œβ”€β”€ inference_vae.py           -> vae inference script
β”‚   └── misc                       -> misc scripts, including batch size search
β”œβ”€β”€ opensora
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ registry.py                -> Registry helper
β”‚Β Β  β”œβ”€β”€ acceleration               -> Acceleration related code
β”‚Β Β  β”œβ”€β”€ datasets                    -> Dataset related code
β”‚Β Β  β”œβ”€β”€ models
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ dit                    -> DiT
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ layers                 -> Common layers
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ vae                    -> VAE as image encoder
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ text_encoder           -> Text encoder
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ classes.py         -> Class id encoder (inference only)
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ clip.py            -> CLIP encoder
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── t5.py              -> T5 encoder
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ dit
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ latte
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ pixart
β”‚Β Β  β”‚Β Β  └── stdit                  -> Our STDiT related code
β”‚Β Β  β”œβ”€β”€ schedulers                 -> Diffusion schedulers
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ iddpm                  -> IDDPM for training and inference
β”‚Β Β  β”‚   └── dpms                   -> DPM-Solver for fast inference
β”‚   └── utils
β”œβ”€β”€ tests                          -> Tests for the project
└── tools                          -> Tools for data processing and more
```

## Configs

Our config files follows [MMEgine](https://github.com/open-mmlab/mmengine). MMEngine will reads the config file (a `.py` file) and parse it into a dictionary-like object.

```plaintext
Open-Sora
└── configs                        -> Configs for training & inference
    β”œβ”€β”€ opensora-v1-1              -> STDiT2 related configs
    β”‚   β”œβ”€β”€ inference
    β”‚   β”‚   β”œβ”€β”€ sample.py          -> Sample videos and images
    β”‚   β”‚   └── sample-ref.py      -> Sample videos with image/video condition
    β”‚   └── train
    β”‚       β”œβ”€β”€ stage1.py          -> Stage 1 training config
    β”‚       β”œβ”€β”€ stage2.py          -> Stage 2 training config
    β”‚       β”œβ”€β”€ stage3.py          -> Stage 3 training config
    β”‚       β”œβ”€β”€ image.py           -> Illustration of image training config
    β”‚       β”œβ”€β”€ video.py           -> Illustration of video training config
    β”‚       └── benchmark.py       -> For batch size searching
    β”œβ”€β”€ opensora                   -> STDiT related configs
    β”‚   β”œβ”€β”€ inference
    β”‚   β”‚   β”œβ”€β”€ 16x256x256.py      -> Sample videos 16 frames 256x256
    β”‚   β”‚   β”œβ”€β”€ 16x512x512.py      -> Sample videos 16 frames 512x512
    β”‚   β”‚   └── 64x512x512.py      -> Sample videos 64 frames 512x512
    β”‚   └── train
    β”‚       β”œβ”€β”€ 16x256x256.py      -> Train on videos 16 frames 256x256
    β”‚       β”œβ”€β”€ 16x256x256.py      -> Train on videos 16 frames 256x256
    β”‚       └── 64x512x512.py      -> Train on videos 64 frames 512x512
    β”œβ”€β”€ dit                        -> DiT related configs
 Β Β  β”‚Β Β  β”œβ”€β”€ inference
 Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ 1x256x256-class.py -> Sample images with ckpts from DiT
 Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ 1x256x256.py       -> Sample images with clip condition
 Β Β  β”‚Β Β  β”‚Β Β  └── 16x256x256.py      -> Sample videos
 Β Β  β”‚Β Β  └── train
 Β Β  β”‚Β Β    Β  β”œβ”€β”€ 1x256x256.py       -> Train on images with clip condition
 Β Β  β”‚Β Β   Β Β  └── 16x256x256.py      -> Train on videos
    β”œβ”€β”€ latte                      -> Latte related configs
    └── pixart                     -> PixArt related configs
```

## Tools

```plaintext
Open-Sora
└── tools
    β”œβ”€β”€ datasets                   -> dataset management related code
    β”œβ”€β”€ scene_cut                  -> scene cut related code
    β”œβ”€β”€ caption                    -> caption related code
    β”œβ”€β”€ scoring                    -> scoring related code
    β”‚   β”œβ”€β”€ aesthetic              -> aesthetic scoring related code
    β”‚   β”œβ”€β”€ matching               -> matching scoring related code
    β”‚   β”œβ”€β”€ ocr                    -> ocr scoring related code
    β”‚   └── optical_flow           -> optical flow scoring related code
    └── frame_interpolation        -> frame interpolation related code