Skip to content

Open-Sora: Democratizing Efficient Video Production for All

Python

update

zhengzangw701ce69458c5
diff --git a/configs/opensora-v1-1/train/stage1-2.py b/configs/opensora-v1-1/train/stage1-2.py
new file mode 100644
index 0000000..2089420
--- /dev/null
+++ b/configs/opensora-v1-1/train/stage1-2.py
@@ -0,0 +1,69 @@
+# Define dataset
+dataset = dict(
+ type="VariableVideoTextDataset",
+ data_path=None,
+ num_frames=None,
+ frame_interval=3,
+ image_size=(None, None),
+ transform_name="resize_crop",
+)
+bucket_config = { # 6s/it
+ "256": {1: (1.0, 254)},
+}
+mask_ratios = {
+ "mask_no": 0.9,
+ "mask_quarter_random": 0.01,
+ "mask_quarter_head": 0.01,
+ "mask_quarter_tail": 0.01,
+ "mask_quarter_head_tail": 0.02,
+ "mask_image_random": 0.01,
+ "mask_image_head": 0.01,
+ "mask_image_tail": 0.01,
+ "mask_image_head_tail": 0.02,
+}
+
+# Define acceleration
+num_workers = 4
+num_bucket_build_workers = 16
+dtype = "bf16"
+grad_checkpoint = True
+plugin = "zero2"
+sp_size = 1
+
+# Define model
+model = dict(
+ type="STDiT2-XL/2",
+ from_pretrained=None,
+ input_sq_size=512, # pretrained model is trained on 512x512
+ enable_flashattn=True,
+ enable_layernorm_kernel=True,
+)
+vae = dict(
+ type="VideoAutoencoderKL",
+ from_pretrained="stabilityai/sd-vae-ft-ema",
+ micro_batch_size=4,
+)
+text_encoder = dict(
+ type="t5",
+ from_pretrained="DeepFloyd/t5-v1_1-xxl",
+ model_max_length=200,
+ shardformer=True,
+)
+scheduler = dict(
+ type="iddpm-speed",
+ timestep_respacing="",
+)
+
+# Others
+seed = 42
+outputs = "outputs"
+wandb = False
+
+epochs = 1000
+log_every = 10
+ckpt_every = 500
+load = None
+
+batch_size = None
+lr = 2e-5
+grad_clip = 1.0