Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- configs/dit/inference/16x256x256.py +31 -0
- configs/dit/inference/1x256x256-class.py +31 -0
- configs/dit/inference/1x256x256.py +32 -0
- configs/dit/train/16x256x256.py +50 -0
- configs/dit/train/1x256x256.py +51 -0
- configs/latte/inference/16x256x256-class.py +30 -0
- configs/latte/inference/16x256x256.py +31 -0
- configs/latte/train/16x256x256.py +49 -0
- configs/opensora-v1-1/inference/sample-ref.py +62 -0
- configs/opensora-v1-1/inference/sample.py +43 -0
- configs/opensora-v1-1/train/benchmark.py +101 -0
- configs/opensora-v1-1/train/image.py +65 -0
- configs/opensora-v1-1/train/stage1.py +77 -0
- configs/opensora-v1-1/train/stage2.py +79 -0
- configs/opensora-v1-1/train/stage3.py +79 -0
- configs/opensora-v1-1/train/video.py +67 -0
- configs/opensora/inference/16x256x256.py +39 -0
- configs/opensora/inference/16x512x512.py +35 -0
- configs/opensora/inference/64x512x512.py +35 -0
- configs/opensora/train/16x256x256-mask.py +60 -0
- configs/opensora/train/16x256x256-spee.py +60 -0
- configs/opensora/train/16x256x256.py +53 -0
- configs/opensora/train/16x512x512.py +54 -0
- configs/opensora/train/360x512x512.py +61 -0
- configs/opensora/train/64x512x512-sp.py +54 -0
- configs/opensora/train/64x512x512.py +54 -0
- configs/pixart/inference/16x256x256.py +32 -0
- configs/pixart/inference/1x1024MS.py +34 -0
- configs/pixart/inference/1x256x256.py +33 -0
- configs/pixart/inference/1x512x512.py +39 -0
- configs/pixart/train/16x256x256.py +53 -0
- configs/pixart/train/1x512x512.py +54 -0
- configs/pixart/train/64x512x512.py +55 -0
configs/dit/inference/16x256x256.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 16
|
| 2 |
+
fps = 8
|
| 3 |
+
image_size = (256, 256)
|
| 4 |
+
|
| 5 |
+
# Define model
|
| 6 |
+
model = dict(
|
| 7 |
+
type="DiT-XL/2",
|
| 8 |
+
condition="text",
|
| 9 |
+
from_pretrained="PRETRAINED_MODEL",
|
| 10 |
+
)
|
| 11 |
+
vae = dict(
|
| 12 |
+
type="VideoAutoencoderKL",
|
| 13 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 14 |
+
)
|
| 15 |
+
text_encoder = dict(
|
| 16 |
+
type="clip",
|
| 17 |
+
from_pretrained="openai/clip-vit-base-patch32",
|
| 18 |
+
model_max_length=77,
|
| 19 |
+
)
|
| 20 |
+
scheduler = dict(
|
| 21 |
+
type="dpm-solver",
|
| 22 |
+
num_sampling_steps=20,
|
| 23 |
+
cfg_scale=4.0,
|
| 24 |
+
)
|
| 25 |
+
dtype = "bf16"
|
| 26 |
+
|
| 27 |
+
# Others
|
| 28 |
+
batch_size = 2
|
| 29 |
+
seed = 42
|
| 30 |
+
prompt_path = "./assets/texts/ucf101_labels.txt"
|
| 31 |
+
save_dir = "./samples/samples/"
|
configs/dit/inference/1x256x256-class.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 1
|
| 2 |
+
fps = 1
|
| 3 |
+
image_size = (256, 256)
|
| 4 |
+
|
| 5 |
+
# Define model
|
| 6 |
+
model = dict(
|
| 7 |
+
type="DiT-XL/2",
|
| 8 |
+
no_temporal_pos_emb=True,
|
| 9 |
+
condition="label_1000",
|
| 10 |
+
from_pretrained="DiT-XL-2-256x256.pt",
|
| 11 |
+
)
|
| 12 |
+
vae = dict(
|
| 13 |
+
type="VideoAutoencoderKL",
|
| 14 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 15 |
+
)
|
| 16 |
+
text_encoder = dict(
|
| 17 |
+
type="classes",
|
| 18 |
+
num_classes=1000,
|
| 19 |
+
)
|
| 20 |
+
scheduler = dict(
|
| 21 |
+
type="dpm-solver",
|
| 22 |
+
num_sampling_steps=20,
|
| 23 |
+
cfg_scale=4.0,
|
| 24 |
+
)
|
| 25 |
+
dtype = "bf16"
|
| 26 |
+
|
| 27 |
+
# Others
|
| 28 |
+
batch_size = 2
|
| 29 |
+
seed = 42
|
| 30 |
+
prompt_path = "./assets/texts/imagenet_id.txt"
|
| 31 |
+
save_dir = "./samples/samples/"
|
configs/dit/inference/1x256x256.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 1
|
| 2 |
+
fps = 1
|
| 3 |
+
image_size = (256, 256)
|
| 4 |
+
|
| 5 |
+
# Define model
|
| 6 |
+
model = dict(
|
| 7 |
+
type="DiT-XL/2",
|
| 8 |
+
no_temporal_pos_emb=True,
|
| 9 |
+
condition="text",
|
| 10 |
+
from_pretrained="PRETRAINED_MODEL",
|
| 11 |
+
)
|
| 12 |
+
vae = dict(
|
| 13 |
+
type="VideoAutoencoderKL",
|
| 14 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 15 |
+
)
|
| 16 |
+
text_encoder = dict(
|
| 17 |
+
type="clip",
|
| 18 |
+
from_pretrained="openai/clip-vit-base-patch32",
|
| 19 |
+
model_max_length=77,
|
| 20 |
+
)
|
| 21 |
+
scheduler = dict(
|
| 22 |
+
type="dpm-solver",
|
| 23 |
+
num_sampling_steps=20,
|
| 24 |
+
cfg_scale=4.0,
|
| 25 |
+
)
|
| 26 |
+
dtype = "bf16"
|
| 27 |
+
|
| 28 |
+
# Others
|
| 29 |
+
batch_size = 2
|
| 30 |
+
seed = 42
|
| 31 |
+
prompt_path = "./assets/texts/imagenet_labels.txt"
|
| 32 |
+
save_dir = "./samples/samples/"
|
configs/dit/train/16x256x256.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=16,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(256, 256),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Define acceleration
|
| 11 |
+
num_workers = 4
|
| 12 |
+
dtype = "bf16"
|
| 13 |
+
grad_checkpoint = True
|
| 14 |
+
plugin = "zero2"
|
| 15 |
+
sp_size = 1
|
| 16 |
+
|
| 17 |
+
# Define model
|
| 18 |
+
model = dict(
|
| 19 |
+
type="DiT-XL/2",
|
| 20 |
+
from_pretrained="DiT-XL-2-256x256.pt",
|
| 21 |
+
enable_flashattn=True,
|
| 22 |
+
enable_layernorm_kernel=True,
|
| 23 |
+
)
|
| 24 |
+
vae = dict(
|
| 25 |
+
type="VideoAutoencoderKL",
|
| 26 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 27 |
+
)
|
| 28 |
+
text_encoder = dict(
|
| 29 |
+
type="clip",
|
| 30 |
+
from_pretrained="openai/clip-vit-base-patch32",
|
| 31 |
+
model_max_length=77,
|
| 32 |
+
)
|
| 33 |
+
scheduler = dict(
|
| 34 |
+
type="iddpm",
|
| 35 |
+
timestep_respacing="",
|
| 36 |
+
)
|
| 37 |
+
|
| 38 |
+
# Others
|
| 39 |
+
seed = 42
|
| 40 |
+
outputs = "outputs"
|
| 41 |
+
wandb = False
|
| 42 |
+
|
| 43 |
+
epochs = 1000
|
| 44 |
+
log_every = 10
|
| 45 |
+
ckpt_every = 1000
|
| 46 |
+
load = None
|
| 47 |
+
|
| 48 |
+
batch_size = 8
|
| 49 |
+
lr = 2e-5
|
| 50 |
+
grad_clip = 1.0
|
configs/dit/train/1x256x256.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=1,
|
| 6 |
+
frame_interval=1,
|
| 7 |
+
image_size=(256, 256),
|
| 8 |
+
transform_name="center",
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
# Define acceleration
|
| 12 |
+
num_workers = 4
|
| 13 |
+
dtype = "bf16"
|
| 14 |
+
grad_checkpoint = False
|
| 15 |
+
plugin = "zero2"
|
| 16 |
+
sp_size = 1
|
| 17 |
+
|
| 18 |
+
# Define model
|
| 19 |
+
model = dict(
|
| 20 |
+
type="DiT-XL/2",
|
| 21 |
+
no_temporal_pos_emb=True,
|
| 22 |
+
enable_flashattn=True,
|
| 23 |
+
enable_layernorm_kernel=True,
|
| 24 |
+
)
|
| 25 |
+
vae = dict(
|
| 26 |
+
type="VideoAutoencoderKL",
|
| 27 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 28 |
+
)
|
| 29 |
+
text_encoder = dict(
|
| 30 |
+
type="clip",
|
| 31 |
+
from_pretrained="openai/clip-vit-base-patch32",
|
| 32 |
+
model_max_length=77,
|
| 33 |
+
)
|
| 34 |
+
scheduler = dict(
|
| 35 |
+
type="iddpm",
|
| 36 |
+
timestep_respacing="",
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
# Others
|
| 40 |
+
seed = 42
|
| 41 |
+
outputs = "outputs"
|
| 42 |
+
wandb = False
|
| 43 |
+
|
| 44 |
+
epochs = 1000
|
| 45 |
+
log_every = 10
|
| 46 |
+
ckpt_every = 1000
|
| 47 |
+
load = None
|
| 48 |
+
|
| 49 |
+
batch_size = 128
|
| 50 |
+
lr = 1e-4 # according to DiT repo
|
| 51 |
+
grad_clip = 1.0
|
configs/latte/inference/16x256x256-class.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 16
|
| 2 |
+
fps = 8
|
| 3 |
+
image_size = (256, 256)
|
| 4 |
+
|
| 5 |
+
# Define model
|
| 6 |
+
model = dict(
|
| 7 |
+
type="Latte-XL/2",
|
| 8 |
+
condition="label_101",
|
| 9 |
+
from_pretrained="Latte-XL-2-256x256-ucf101.pt",
|
| 10 |
+
)
|
| 11 |
+
vae = dict(
|
| 12 |
+
type="VideoAutoencoderKL",
|
| 13 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 14 |
+
)
|
| 15 |
+
text_encoder = dict(
|
| 16 |
+
type="classes",
|
| 17 |
+
num_classes=101,
|
| 18 |
+
)
|
| 19 |
+
scheduler = dict(
|
| 20 |
+
type="dpm-solver",
|
| 21 |
+
num_sampling_steps=20,
|
| 22 |
+
cfg_scale=4.0,
|
| 23 |
+
)
|
| 24 |
+
dtype = "bf16"
|
| 25 |
+
|
| 26 |
+
# Others
|
| 27 |
+
batch_size = 2
|
| 28 |
+
seed = 42
|
| 29 |
+
prompt_path = "./assets/texts/ucf101_id.txt"
|
| 30 |
+
save_dir = "./samples/samples/"
|
configs/latte/inference/16x256x256.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 16
|
| 2 |
+
fps = 8
|
| 3 |
+
image_size = (256, 256)
|
| 4 |
+
|
| 5 |
+
# Define model
|
| 6 |
+
model = dict(
|
| 7 |
+
type="Latte-XL/2",
|
| 8 |
+
condition="text",
|
| 9 |
+
from_pretrained="PRETRAINED_MODEL",
|
| 10 |
+
)
|
| 11 |
+
vae = dict(
|
| 12 |
+
type="VideoAutoencoderKL",
|
| 13 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 14 |
+
)
|
| 15 |
+
text_encoder = dict(
|
| 16 |
+
type="clip",
|
| 17 |
+
from_pretrained="openai/clip-vit-base-patch32",
|
| 18 |
+
model_max_length=77,
|
| 19 |
+
)
|
| 20 |
+
scheduler = dict(
|
| 21 |
+
type="dpm-solver",
|
| 22 |
+
num_sampling_steps=20,
|
| 23 |
+
cfg_scale=4.0,
|
| 24 |
+
)
|
| 25 |
+
dtype = "bf16"
|
| 26 |
+
|
| 27 |
+
# Others
|
| 28 |
+
batch_size = 2
|
| 29 |
+
seed = 42
|
| 30 |
+
prompt_path = "./assets/texts/ucf101_labels.txt"
|
| 31 |
+
save_dir = "./samples/samples/"
|
configs/latte/train/16x256x256.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=16,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(256, 256),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Define acceleration
|
| 11 |
+
num_workers = 4
|
| 12 |
+
dtype = "bf16"
|
| 13 |
+
grad_checkpoint = True
|
| 14 |
+
plugin = "zero2"
|
| 15 |
+
sp_size = 1
|
| 16 |
+
|
| 17 |
+
# Define model
|
| 18 |
+
model = dict(
|
| 19 |
+
type="Latte-XL/2",
|
| 20 |
+
enable_flashattn=True,
|
| 21 |
+
enable_layernorm_kernel=True,
|
| 22 |
+
)
|
| 23 |
+
vae = dict(
|
| 24 |
+
type="VideoAutoencoderKL",
|
| 25 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 26 |
+
)
|
| 27 |
+
text_encoder = dict(
|
| 28 |
+
type="clip",
|
| 29 |
+
from_pretrained="openai/clip-vit-base-patch32",
|
| 30 |
+
model_max_length=77,
|
| 31 |
+
)
|
| 32 |
+
scheduler = dict(
|
| 33 |
+
type="iddpm",
|
| 34 |
+
timestep_respacing="",
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
# Others
|
| 38 |
+
seed = 42
|
| 39 |
+
outputs = "outputs"
|
| 40 |
+
wandb = False
|
| 41 |
+
|
| 42 |
+
epochs = 1000
|
| 43 |
+
log_every = 10
|
| 44 |
+
ckpt_every = 1000
|
| 45 |
+
load = None
|
| 46 |
+
|
| 47 |
+
batch_size = 8
|
| 48 |
+
lr = 2e-5
|
| 49 |
+
grad_clip = 1.0
|
configs/opensora-v1-1/inference/sample-ref.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 16
|
| 2 |
+
frame_interval = 3
|
| 3 |
+
fps = 24
|
| 4 |
+
image_size = (240, 426)
|
| 5 |
+
multi_resolution = "STDiT2"
|
| 6 |
+
|
| 7 |
+
# Condition
|
| 8 |
+
prompt_path = None
|
| 9 |
+
prompt = [
|
| 10 |
+
"A car driving on the ocean.",
|
| 11 |
+
'Drone view of waves crashing against the rugged cliffs along Big Sur\'s garay point beach. The crashing blue waters create white-tipped waves, while the golden light of the setting sun illuminates the rocky shore. A small island with a lighthouse sits in the distance, and green shrubbery covers the cliff\'s edge. The steep drop from the road down to the beach is a dramatic feat, with the cliff\'s edges jutting out over the sea. This is a view that captures the raw beauty of the coast and the rugged landscape of the Pacific Coast Highway.{"reference_path": "assets/images/condition/cliff.png", "mask_strategy": "0"}',
|
| 12 |
+
"In an ornate, historical hall, a massive tidal wave peaks and begins to crash. Two surfers, seizing the moment, skillfully navigate the face of the wave.",
|
| 13 |
+
]
|
| 14 |
+
|
| 15 |
+
loop = 2
|
| 16 |
+
condition_frame_length = 4
|
| 17 |
+
reference_path = [
|
| 18 |
+
"https://cdn.openai.com/tmp/s/interp/d0.mp4",
|
| 19 |
+
None,
|
| 20 |
+
"assets/images/condition/wave.png",
|
| 21 |
+
]
|
| 22 |
+
# valid when reference_path is not None
|
| 23 |
+
# (loop id, ref id, ref start, length, target start)
|
| 24 |
+
mask_strategy = [
|
| 25 |
+
"0,0,0,0,8,0.3",
|
| 26 |
+
None,
|
| 27 |
+
"0",
|
| 28 |
+
]
|
| 29 |
+
|
| 30 |
+
# Define model
|
| 31 |
+
model = dict(
|
| 32 |
+
type="STDiT2-XL/2",
|
| 33 |
+
from_pretrained=None,
|
| 34 |
+
input_sq_size=512,
|
| 35 |
+
qk_norm=True,
|
| 36 |
+
enable_flashattn=True,
|
| 37 |
+
enable_layernorm_kernel=True,
|
| 38 |
+
)
|
| 39 |
+
vae = dict(
|
| 40 |
+
type="VideoAutoencoderKL",
|
| 41 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 42 |
+
cache_dir=None, # "/mnt/hdd/cached_models",
|
| 43 |
+
micro_batch_size=4,
|
| 44 |
+
)
|
| 45 |
+
text_encoder = dict(
|
| 46 |
+
type="t5",
|
| 47 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 48 |
+
cache_dir=None, # "/mnt/hdd/cached_models",
|
| 49 |
+
model_max_length=200,
|
| 50 |
+
)
|
| 51 |
+
scheduler = dict(
|
| 52 |
+
type="iddpm",
|
| 53 |
+
num_sampling_steps=100,
|
| 54 |
+
cfg_scale=7.0,
|
| 55 |
+
cfg_channel=3, # or None
|
| 56 |
+
)
|
| 57 |
+
dtype = "bf16"
|
| 58 |
+
|
| 59 |
+
# Others
|
| 60 |
+
batch_size = 1
|
| 61 |
+
seed = 42
|
| 62 |
+
save_dir = "./samples/samples/"
|
configs/opensora-v1-1/inference/sample.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 16
|
| 2 |
+
frame_interval = 3
|
| 3 |
+
fps = 24
|
| 4 |
+
image_size = (240, 426)
|
| 5 |
+
multi_resolution = "STDiT2"
|
| 6 |
+
|
| 7 |
+
# Define model
|
| 8 |
+
model = dict(
|
| 9 |
+
type="STDiT2-XL/2",
|
| 10 |
+
from_pretrained=None,
|
| 11 |
+
input_sq_size=512,
|
| 12 |
+
qk_norm=True,
|
| 13 |
+
enable_flashattn=True,
|
| 14 |
+
enable_layernorm_kernel=True,
|
| 15 |
+
)
|
| 16 |
+
vae = dict(
|
| 17 |
+
type="VideoAutoencoderKL",
|
| 18 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 19 |
+
cache_dir=None, # "/mnt/hdd/cached_models",
|
| 20 |
+
micro_batch_size=4,
|
| 21 |
+
)
|
| 22 |
+
text_encoder = dict(
|
| 23 |
+
type="t5",
|
| 24 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 25 |
+
cache_dir=None, # "/mnt/hdd/cached_models",
|
| 26 |
+
model_max_length=200,
|
| 27 |
+
)
|
| 28 |
+
scheduler = dict(
|
| 29 |
+
type="iddpm",
|
| 30 |
+
num_sampling_steps=100,
|
| 31 |
+
cfg_scale=7.0,
|
| 32 |
+
cfg_channel=3, # or None
|
| 33 |
+
)
|
| 34 |
+
dtype = "bf16"
|
| 35 |
+
|
| 36 |
+
# Condition
|
| 37 |
+
prompt_path = "./assets/texts/t2v_samples.txt"
|
| 38 |
+
prompt = None # prompt has higher priority than prompt_path
|
| 39 |
+
|
| 40 |
+
# Others
|
| 41 |
+
batch_size = 1
|
| 42 |
+
seed = 42
|
| 43 |
+
save_dir = "./samples/samples/"
|
configs/opensora-v1-1/train/benchmark.py
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# this file is only for batch size search and is not used for training
|
| 2 |
+
|
| 3 |
+
# Define dataset
|
| 4 |
+
dataset = dict(
|
| 5 |
+
type="VariableVideoTextDataset",
|
| 6 |
+
data_path=None,
|
| 7 |
+
num_frames=None,
|
| 8 |
+
frame_interval=3,
|
| 9 |
+
image_size=(None, None),
|
| 10 |
+
transform_name="resize_crop",
|
| 11 |
+
)
|
| 12 |
+
|
| 13 |
+
# bucket config format:
|
| 14 |
+
# 1. { resolution: {num_frames: (prob, batch_size)} }, in this case batch_size is ignored when searching
|
| 15 |
+
# 2. { resolution: {num_frames: (prob, (max_batch_size, ))} }, batch_size is searched in the range [batch_size_start, max_batch_size), batch_size_start is configured via CLI
|
| 16 |
+
# 3. { resolution: {num_frames: (prob, (min_batch_size, max_batch_size))} }, batch_size is searched in the range [min_batch_size, max_batch_size)
|
| 17 |
+
# 4. { resolution: {num_frames: (prob, (min_batch_size, max_batch_size, step_size))} }, batch_size is searched in the range [min_batch_size, max_batch_size) with step_size (grid search)
|
| 18 |
+
# 5. { resolution: {num_frames: (0.0, None)} }, this bucket will not be used
|
| 19 |
+
|
| 20 |
+
bucket_config = {
|
| 21 |
+
# == manual search ==
|
| 22 |
+
# "240p": {128: (1.0, 2)}, # 4.28s/it
|
| 23 |
+
# "240p": {64: (1.0, 4)},
|
| 24 |
+
# "240p": {32: (1.0, 8)}, # 4.6s/it
|
| 25 |
+
# "240p": {16: (1.0, 16)}, # 4.6s/it
|
| 26 |
+
# "480p": {16: (1.0, 4)}, # 4.6s/it
|
| 27 |
+
# "720p": {16: (1.0, 2)}, # 5.89s/it
|
| 28 |
+
# "256": {1: (1.0, 256)}, # 4.5s/it
|
| 29 |
+
# "512": {1: (1.0, 96)}, # 4.7s/it
|
| 30 |
+
# "512": {1: (1.0, 128)}, # 6.3s/it
|
| 31 |
+
# "480p": {1: (1.0, 50)}, # 4.0s/it
|
| 32 |
+
# "1024": {1: (1.0, 32)}, # 6.8s/it
|
| 33 |
+
# "1024": {1: (1.0, 20)}, # 4.3s/it
|
| 34 |
+
# "1080p": {1: (1.0, 16)}, # 8.6s/it
|
| 35 |
+
# "1080p": {1: (1.0, 8)}, # 4.4s/it
|
| 36 |
+
# == stage 2 ==
|
| 37 |
+
# "240p": {
|
| 38 |
+
# 16: (1.0, (2, 32)),
|
| 39 |
+
# 32: (1.0, (2, 16)),
|
| 40 |
+
# 64: (1.0, (2, 8)),
|
| 41 |
+
# 128: (1.0, (2, 6)),
|
| 42 |
+
# },
|
| 43 |
+
# "256": {1: (1.0, (128, 300))},
|
| 44 |
+
# "512": {1: (0.5, (64, 128))},
|
| 45 |
+
# "480p": {1: (0.4, (32, 128)), 16: (0.4, (2, 32)), 32: (0.0, None)},
|
| 46 |
+
# "720p": {16: (0.1, (2, 16)), 32: (0.0, None)}, # No examples now
|
| 47 |
+
# "1024": {1: (0.3, (8, 64))},
|
| 48 |
+
# "1080p": {1: (0.3, (2, 32))},
|
| 49 |
+
# == stage 3 ==
|
| 50 |
+
"720p": {1: (20, 40), 32: (0.5, (2, 4)), 64: (0.5, (1, 1))},
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
# Define acceleration
|
| 55 |
+
num_workers = 4
|
| 56 |
+
num_bucket_build_workers = 16
|
| 57 |
+
dtype = "bf16"
|
| 58 |
+
grad_checkpoint = True
|
| 59 |
+
plugin = "zero2"
|
| 60 |
+
sp_size = 1
|
| 61 |
+
|
| 62 |
+
# Define model
|
| 63 |
+
model = dict(
|
| 64 |
+
type="STDiT2-XL/2",
|
| 65 |
+
from_pretrained=None,
|
| 66 |
+
input_sq_size=512, # pretrained model is trained on 512x512
|
| 67 |
+
qk_norm=True,
|
| 68 |
+
enable_flashattn=True,
|
| 69 |
+
enable_layernorm_kernel=True,
|
| 70 |
+
)
|
| 71 |
+
vae = dict(
|
| 72 |
+
type="VideoAutoencoderKL",
|
| 73 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 74 |
+
micro_batch_size=4,
|
| 75 |
+
local_files_only=True,
|
| 76 |
+
)
|
| 77 |
+
text_encoder = dict(
|
| 78 |
+
type="t5",
|
| 79 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 80 |
+
model_max_length=200,
|
| 81 |
+
shardformer=True,
|
| 82 |
+
local_files_only=True,
|
| 83 |
+
)
|
| 84 |
+
scheduler = dict(
|
| 85 |
+
type="iddpm",
|
| 86 |
+
timestep_respacing="",
|
| 87 |
+
)
|
| 88 |
+
|
| 89 |
+
# Others
|
| 90 |
+
seed = 42
|
| 91 |
+
outputs = "outputs"
|
| 92 |
+
wandb = False
|
| 93 |
+
|
| 94 |
+
epochs = 1000
|
| 95 |
+
log_every = 10
|
| 96 |
+
ckpt_every = 1000
|
| 97 |
+
load = None
|
| 98 |
+
|
| 99 |
+
batch_size = None
|
| 100 |
+
lr = 2e-5
|
| 101 |
+
grad_clip = 1.0
|
configs/opensora-v1-1/train/image.py
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VariableVideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=None,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(None, None),
|
| 8 |
+
transform_name="resize_crop",
|
| 9 |
+
)
|
| 10 |
+
bucket_config = { # 6s/it
|
| 11 |
+
"256": {1: (1.0, 256)},
|
| 12 |
+
"512": {1: (1.0, 80)},
|
| 13 |
+
"480p": {1: (1.0, 52)},
|
| 14 |
+
"1024": {1: (1.0, 20)},
|
| 15 |
+
"1080p": {1: (1.0, 8)},
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
# Define acceleration
|
| 19 |
+
num_workers = 4
|
| 20 |
+
num_bucket_build_workers = 16
|
| 21 |
+
dtype = "bf16"
|
| 22 |
+
grad_checkpoint = True
|
| 23 |
+
plugin = "zero2"
|
| 24 |
+
sp_size = 1
|
| 25 |
+
|
| 26 |
+
# Define model
|
| 27 |
+
model = dict(
|
| 28 |
+
type="STDiT2-XL/2",
|
| 29 |
+
from_pretrained=None,
|
| 30 |
+
input_sq_size=512, # pretrained model is trained on 512x512
|
| 31 |
+
qk_norm=True,
|
| 32 |
+
enable_flashattn=True,
|
| 33 |
+
enable_layernorm_kernel=True,
|
| 34 |
+
)
|
| 35 |
+
vae = dict(
|
| 36 |
+
type="VideoAutoencoderKL",
|
| 37 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 38 |
+
micro_batch_size=4,
|
| 39 |
+
local_files_only=True,
|
| 40 |
+
)
|
| 41 |
+
text_encoder = dict(
|
| 42 |
+
type="t5",
|
| 43 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 44 |
+
model_max_length=200,
|
| 45 |
+
shardformer=True,
|
| 46 |
+
local_files_only=True,
|
| 47 |
+
)
|
| 48 |
+
scheduler = dict(
|
| 49 |
+
type="iddpm",
|
| 50 |
+
timestep_respacing="",
|
| 51 |
+
)
|
| 52 |
+
|
| 53 |
+
# Others
|
| 54 |
+
seed = 42
|
| 55 |
+
outputs = "outputs"
|
| 56 |
+
wandb = False
|
| 57 |
+
|
| 58 |
+
epochs = 1000
|
| 59 |
+
log_every = 10
|
| 60 |
+
ckpt_every = 500
|
| 61 |
+
load = None
|
| 62 |
+
|
| 63 |
+
batch_size = 10 # only for logging
|
| 64 |
+
lr = 2e-5
|
| 65 |
+
grad_clip = 1.0
|
configs/opensora-v1-1/train/stage1.py
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VariableVideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=None,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(None, None),
|
| 8 |
+
transform_name="resize_crop",
|
| 9 |
+
)
|
| 10 |
+
# IMG: 1024 (20%) 512 (30%) 256 (50%) drop (50%)
|
| 11 |
+
bucket_config = { # 1s/it
|
| 12 |
+
"144p": {1: (0.5, 48), 16: (1.0, 6), 32: (1.0, 3), 96: (1.0, 1)},
|
| 13 |
+
"256": {1: (0.5, 24), 16: (0.5, 3), 48: (0.5, 1), 64: (0.0, None)},
|
| 14 |
+
"240p": {16: (0.3, 2), 32: (0.3, 1), 64: (0.0, None)},
|
| 15 |
+
"512": {1: (0.4, 12)},
|
| 16 |
+
"1024": {1: (0.3, 3)},
|
| 17 |
+
}
|
| 18 |
+
mask_ratios = {
|
| 19 |
+
"mask_no": 0.75,
|
| 20 |
+
"mask_quarter_random": 0.025,
|
| 21 |
+
"mask_quarter_head": 0.025,
|
| 22 |
+
"mask_quarter_tail": 0.025,
|
| 23 |
+
"mask_quarter_head_tail": 0.05,
|
| 24 |
+
"mask_image_random": 0.025,
|
| 25 |
+
"mask_image_head": 0.025,
|
| 26 |
+
"mask_image_tail": 0.025,
|
| 27 |
+
"mask_image_head_tail": 0.05,
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
# Define acceleration
|
| 31 |
+
num_workers = 8
|
| 32 |
+
num_bucket_build_workers = 16
|
| 33 |
+
dtype = "bf16"
|
| 34 |
+
grad_checkpoint = False
|
| 35 |
+
plugin = "zero2"
|
| 36 |
+
sp_size = 1
|
| 37 |
+
|
| 38 |
+
# Define model
|
| 39 |
+
model = dict(
|
| 40 |
+
type="STDiT2-XL/2",
|
| 41 |
+
from_pretrained=None,
|
| 42 |
+
input_sq_size=512, # pretrained model is trained on 512x512
|
| 43 |
+
qk_norm=True,
|
| 44 |
+
enable_flashattn=True,
|
| 45 |
+
enable_layernorm_kernel=True,
|
| 46 |
+
)
|
| 47 |
+
vae = dict(
|
| 48 |
+
type="VideoAutoencoderKL",
|
| 49 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 50 |
+
micro_batch_size=4,
|
| 51 |
+
local_files_only=True,
|
| 52 |
+
)
|
| 53 |
+
text_encoder = dict(
|
| 54 |
+
type="t5",
|
| 55 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 56 |
+
model_max_length=200,
|
| 57 |
+
shardformer=True,
|
| 58 |
+
local_files_only=True,
|
| 59 |
+
)
|
| 60 |
+
scheduler = dict(
|
| 61 |
+
type="iddpm",
|
| 62 |
+
timestep_respacing="",
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
# Others
|
| 66 |
+
seed = 42
|
| 67 |
+
outputs = "outputs"
|
| 68 |
+
wandb = False
|
| 69 |
+
|
| 70 |
+
epochs = 1000
|
| 71 |
+
log_every = 10
|
| 72 |
+
ckpt_every = 500
|
| 73 |
+
load = None
|
| 74 |
+
|
| 75 |
+
batch_size = None
|
| 76 |
+
lr = 2e-5
|
| 77 |
+
grad_clip = 1.0
|
configs/opensora-v1-1/train/stage2.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VariableVideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=None,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(None, None),
|
| 8 |
+
transform_name="resize_crop",
|
| 9 |
+
)
|
| 10 |
+
bucket_config = { # 7s/it
|
| 11 |
+
"144p": {1: (1.0, 48), 16: (1.0, 17), 32: (1.0, 9), 64: (1.0, 4), 128: (1.0, 1)},
|
| 12 |
+
"256": {1: (0.8, 254), 16: (0.5, 17), 32: (0.5, 9), 64: (0.5, 4), 128: (0.5, 1)},
|
| 13 |
+
"240p": {1: (0.1, 20), 16: (0.9, 17), 32: (0.8, 9), 64: (0.8, 4), 128: (0.8, 2)},
|
| 14 |
+
"512": {1: (0.5, 86), 16: (0.2, 4), 32: (0.2, 2), 64: (0.2, 1), 128: (0.0, None)},
|
| 15 |
+
"480p": {1: (0.4, 54), 16: (0.4, 4), 32: (0.0, None)},
|
| 16 |
+
"720p": {1: (0.1, 20), 16: (0.1, 2), 32: (0.0, None)},
|
| 17 |
+
"1024": {1: (0.3, 20)},
|
| 18 |
+
"1080p": {1: (0.4, 8)},
|
| 19 |
+
}
|
| 20 |
+
mask_ratios = {
|
| 21 |
+
"mask_no": 0.75,
|
| 22 |
+
"mask_quarter_random": 0.025,
|
| 23 |
+
"mask_quarter_head": 0.025,
|
| 24 |
+
"mask_quarter_tail": 0.025,
|
| 25 |
+
"mask_quarter_head_tail": 0.05,
|
| 26 |
+
"mask_image_random": 0.025,
|
| 27 |
+
"mask_image_head": 0.025,
|
| 28 |
+
"mask_image_tail": 0.025,
|
| 29 |
+
"mask_image_head_tail": 0.05,
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
# Define acceleration
|
| 33 |
+
num_workers = 8
|
| 34 |
+
num_bucket_build_workers = 16
|
| 35 |
+
dtype = "bf16"
|
| 36 |
+
grad_checkpoint = True
|
| 37 |
+
plugin = "zero2"
|
| 38 |
+
sp_size = 1
|
| 39 |
+
|
| 40 |
+
# Define model
|
| 41 |
+
model = dict(
|
| 42 |
+
type="STDiT2-XL/2",
|
| 43 |
+
from_pretrained=None,
|
| 44 |
+
input_sq_size=512, # pretrained model is trained on 512x512
|
| 45 |
+
qk_norm=True,
|
| 46 |
+
enable_flashattn=True,
|
| 47 |
+
enable_layernorm_kernel=True,
|
| 48 |
+
)
|
| 49 |
+
vae = dict(
|
| 50 |
+
type="VideoAutoencoderKL",
|
| 51 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 52 |
+
micro_batch_size=4,
|
| 53 |
+
local_files_only=True,
|
| 54 |
+
)
|
| 55 |
+
text_encoder = dict(
|
| 56 |
+
type="t5",
|
| 57 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 58 |
+
model_max_length=200,
|
| 59 |
+
shardformer=True,
|
| 60 |
+
local_files_only=True,
|
| 61 |
+
)
|
| 62 |
+
scheduler = dict(
|
| 63 |
+
type="iddpm",
|
| 64 |
+
timestep_respacing="",
|
| 65 |
+
)
|
| 66 |
+
|
| 67 |
+
# Others
|
| 68 |
+
seed = 42
|
| 69 |
+
outputs = "outputs"
|
| 70 |
+
wandb = False
|
| 71 |
+
|
| 72 |
+
epochs = 1000
|
| 73 |
+
log_every = 10
|
| 74 |
+
ckpt_every = 500
|
| 75 |
+
load = None
|
| 76 |
+
|
| 77 |
+
batch_size = None
|
| 78 |
+
lr = 2e-5
|
| 79 |
+
grad_clip = 1.0
|
configs/opensora-v1-1/train/stage3.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VariableVideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=None,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(None, None),
|
| 8 |
+
transform_name="resize_crop",
|
| 9 |
+
)
|
| 10 |
+
bucket_config = { # 13s/it
|
| 11 |
+
"144p": {1: (1.0, 200), 16: (1.0, 36), 32: (1.0, 18), 64: (1.0, 9), 128: (1.0, 4)},
|
| 12 |
+
"256": {1: (0.8, 200), 16: (0.5, 22), 32: (0.5, 11), 64: (0.5, 6), 128: (0.8, 4)},
|
| 13 |
+
"240p": {1: (0.8, 200), 16: (0.5, 22), 32: (0.5, 10), 64: (0.5, 6), 128: (0.5, 3)},
|
| 14 |
+
"360p": {1: (0.5, 120), 16: (0.5, 9), 32: (0.5, 4), 64: (0.5, 2), 128: (0.5, 1)},
|
| 15 |
+
"512": {1: (0.5, 120), 16: (0.5, 9), 32: (0.5, 4), 64: (0.5, 2), 128: (0.8, 1)},
|
| 16 |
+
"480p": {1: (0.4, 80), 16: (0.6, 6), 32: (0.6, 3), 64: (0.6, 1), 128: (0.0, None)},
|
| 17 |
+
"720p": {1: (0.4, 40), 16: (0.6, 3), 32: (0.6, 1), 96: (0.0, None)},
|
| 18 |
+
"1024": {1: (0.3, 40)},
|
| 19 |
+
}
|
| 20 |
+
mask_ratios = {
|
| 21 |
+
"mask_no": 0.75,
|
| 22 |
+
"mask_quarter_random": 0.025,
|
| 23 |
+
"mask_quarter_head": 0.025,
|
| 24 |
+
"mask_quarter_tail": 0.025,
|
| 25 |
+
"mask_quarter_head_tail": 0.05,
|
| 26 |
+
"mask_image_random": 0.025,
|
| 27 |
+
"mask_image_head": 0.025,
|
| 28 |
+
"mask_image_tail": 0.025,
|
| 29 |
+
"mask_image_head_tail": 0.05,
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
# Define acceleration
|
| 33 |
+
num_workers = 8
|
| 34 |
+
num_bucket_build_workers = 16
|
| 35 |
+
dtype = "bf16"
|
| 36 |
+
grad_checkpoint = True
|
| 37 |
+
plugin = "zero2"
|
| 38 |
+
sp_size = 1
|
| 39 |
+
|
| 40 |
+
# Define model
|
| 41 |
+
model = dict(
|
| 42 |
+
type="STDiT2-XL/2",
|
| 43 |
+
from_pretrained=None,
|
| 44 |
+
input_sq_size=512, # pretrained model is trained on 512x512
|
| 45 |
+
qk_norm=True,
|
| 46 |
+
enable_flashattn=True,
|
| 47 |
+
enable_layernorm_kernel=True,
|
| 48 |
+
)
|
| 49 |
+
vae = dict(
|
| 50 |
+
type="VideoAutoencoderKL",
|
| 51 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 52 |
+
micro_batch_size=4,
|
| 53 |
+
local_files_only=True,
|
| 54 |
+
)
|
| 55 |
+
text_encoder = dict(
|
| 56 |
+
type="t5",
|
| 57 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 58 |
+
model_max_length=200,
|
| 59 |
+
shardformer=True,
|
| 60 |
+
local_files_only=True,
|
| 61 |
+
)
|
| 62 |
+
scheduler = dict(
|
| 63 |
+
type="iddpm",
|
| 64 |
+
timestep_respacing="",
|
| 65 |
+
)
|
| 66 |
+
|
| 67 |
+
# Others
|
| 68 |
+
seed = 42
|
| 69 |
+
outputs = "outputs"
|
| 70 |
+
wandb = False
|
| 71 |
+
|
| 72 |
+
epochs = 1000
|
| 73 |
+
log_every = 10
|
| 74 |
+
ckpt_every = 500
|
| 75 |
+
load = None
|
| 76 |
+
|
| 77 |
+
batch_size = None
|
| 78 |
+
lr = 2e-5
|
| 79 |
+
grad_clip = 1.0
|
configs/opensora-v1-1/train/video.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VariableVideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=None,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(None, None),
|
| 8 |
+
transform_name="resize_crop",
|
| 9 |
+
)
|
| 10 |
+
bucket_config = { # 6s/it
|
| 11 |
+
"240p": {16: (1.0, 16), 32: (1.0, 8), 64: (1.0, 4), 128: (1.0, 2)},
|
| 12 |
+
"256": {1: (1.0, 256)},
|
| 13 |
+
"512": {1: (0.5, 80)},
|
| 14 |
+
"480p": {1: (0.4, 52), 16: (0.4, 4), 32: (0.0, None)},
|
| 15 |
+
"720p": {16: (0.1, 2), 32: (0.0, None)}, # No examples now
|
| 16 |
+
"1024": {1: (0.3, 20)},
|
| 17 |
+
"1080p": {1: (0.3, 8)},
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
# Define acceleration
|
| 21 |
+
num_workers = 4
|
| 22 |
+
num_bucket_build_workers = 16
|
| 23 |
+
dtype = "bf16"
|
| 24 |
+
grad_checkpoint = True
|
| 25 |
+
plugin = "zero2"
|
| 26 |
+
sp_size = 1
|
| 27 |
+
|
| 28 |
+
# Define model
|
| 29 |
+
model = dict(
|
| 30 |
+
type="STDiT2-XL/2",
|
| 31 |
+
from_pretrained=None,
|
| 32 |
+
input_sq_size=512, # pretrained model is trained on 512x512
|
| 33 |
+
qk_norm=True,
|
| 34 |
+
enable_flashattn=True,
|
| 35 |
+
enable_layernorm_kernel=True,
|
| 36 |
+
)
|
| 37 |
+
vae = dict(
|
| 38 |
+
type="VideoAutoencoderKL",
|
| 39 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 40 |
+
micro_batch_size=4,
|
| 41 |
+
local_files_only=True,
|
| 42 |
+
)
|
| 43 |
+
text_encoder = dict(
|
| 44 |
+
type="t5",
|
| 45 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 46 |
+
model_max_length=200,
|
| 47 |
+
shardformer=True,
|
| 48 |
+
local_files_only=True,
|
| 49 |
+
)
|
| 50 |
+
scheduler = dict(
|
| 51 |
+
type="iddpm",
|
| 52 |
+
timestep_respacing="",
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
+
# Others
|
| 56 |
+
seed = 42
|
| 57 |
+
outputs = "outputs"
|
| 58 |
+
wandb = False
|
| 59 |
+
|
| 60 |
+
epochs = 1000
|
| 61 |
+
log_every = 10
|
| 62 |
+
ckpt_every = 500
|
| 63 |
+
load = None
|
| 64 |
+
|
| 65 |
+
batch_size = 10 # only for logging
|
| 66 |
+
lr = 2e-5
|
| 67 |
+
grad_clip = 1.0
|
configs/opensora/inference/16x256x256.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 16
|
| 2 |
+
fps = 24 // 3
|
| 3 |
+
image_size = (256, 256)
|
| 4 |
+
|
| 5 |
+
# Define model
|
| 6 |
+
model = dict(
|
| 7 |
+
type="STDiT-XL/2",
|
| 8 |
+
space_scale=0.5,
|
| 9 |
+
time_scale=1.0,
|
| 10 |
+
enable_flashattn=True,
|
| 11 |
+
enable_layernorm_kernel=True,
|
| 12 |
+
from_pretrained="PRETRAINED_MODEL",
|
| 13 |
+
)
|
| 14 |
+
vae = dict(
|
| 15 |
+
type="VideoAutoencoderKL",
|
| 16 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 17 |
+
micro_batch_size=4,
|
| 18 |
+
)
|
| 19 |
+
text_encoder = dict(
|
| 20 |
+
type="t5",
|
| 21 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 22 |
+
model_max_length=120,
|
| 23 |
+
)
|
| 24 |
+
scheduler = dict(
|
| 25 |
+
type="iddpm",
|
| 26 |
+
num_sampling_steps=100,
|
| 27 |
+
cfg_scale=7.0,
|
| 28 |
+
cfg_channel=3, # or None
|
| 29 |
+
)
|
| 30 |
+
dtype = "bf16"
|
| 31 |
+
|
| 32 |
+
# Condition
|
| 33 |
+
prompt_path = "./assets/texts/t2v_samples.txt"
|
| 34 |
+
prompt = None # prompt has higher priority than prompt_path
|
| 35 |
+
|
| 36 |
+
# Others
|
| 37 |
+
batch_size = 1
|
| 38 |
+
seed = 42
|
| 39 |
+
save_dir = "./samples/samples/"
|
configs/opensora/inference/16x512x512.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 16
|
| 2 |
+
fps = 24 // 3
|
| 3 |
+
image_size = (512, 512)
|
| 4 |
+
|
| 5 |
+
# Define model
|
| 6 |
+
model = dict(
|
| 7 |
+
type="STDiT-XL/2",
|
| 8 |
+
space_scale=1.0,
|
| 9 |
+
time_scale=1.0,
|
| 10 |
+
enable_flashattn=True,
|
| 11 |
+
enable_layernorm_kernel=True,
|
| 12 |
+
from_pretrained="PRETRAINED_MODEL",
|
| 13 |
+
)
|
| 14 |
+
vae = dict(
|
| 15 |
+
type="VideoAutoencoderKL",
|
| 16 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 17 |
+
micro_batch_size=2,
|
| 18 |
+
)
|
| 19 |
+
text_encoder = dict(
|
| 20 |
+
type="t5",
|
| 21 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 22 |
+
model_max_length=120,
|
| 23 |
+
)
|
| 24 |
+
scheduler = dict(
|
| 25 |
+
type="iddpm",
|
| 26 |
+
num_sampling_steps=100,
|
| 27 |
+
cfg_scale=7.0,
|
| 28 |
+
)
|
| 29 |
+
dtype = "bf16"
|
| 30 |
+
|
| 31 |
+
# Others
|
| 32 |
+
batch_size = 2
|
| 33 |
+
seed = 42
|
| 34 |
+
prompt_path = "./assets/texts/t2v_samples.txt"
|
| 35 |
+
save_dir = "./samples/samples/"
|
configs/opensora/inference/64x512x512.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 64
|
| 2 |
+
fps = 24 // 2
|
| 3 |
+
image_size = (512, 512)
|
| 4 |
+
|
| 5 |
+
# Define model
|
| 6 |
+
model = dict(
|
| 7 |
+
type="STDiT-XL/2",
|
| 8 |
+
space_scale=1.0,
|
| 9 |
+
time_scale=2 / 3,
|
| 10 |
+
enable_flashattn=True,
|
| 11 |
+
enable_layernorm_kernel=True,
|
| 12 |
+
from_pretrained="PRETRAINED_MODEL",
|
| 13 |
+
)
|
| 14 |
+
vae = dict(
|
| 15 |
+
type="VideoAutoencoderKL",
|
| 16 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 17 |
+
micro_batch_size=128,
|
| 18 |
+
)
|
| 19 |
+
text_encoder = dict(
|
| 20 |
+
type="t5",
|
| 21 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 22 |
+
model_max_length=120,
|
| 23 |
+
)
|
| 24 |
+
scheduler = dict(
|
| 25 |
+
type="iddpm",
|
| 26 |
+
num_sampling_steps=100,
|
| 27 |
+
cfg_scale=7.0,
|
| 28 |
+
)
|
| 29 |
+
dtype = "bf16"
|
| 30 |
+
|
| 31 |
+
# Others
|
| 32 |
+
batch_size = 1
|
| 33 |
+
seed = 42
|
| 34 |
+
prompt_path = "./assets/texts/t2v_samples.txt"
|
| 35 |
+
save_dir = "./samples/samples/"
|
configs/opensora/train/16x256x256-mask.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=16,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(256, 256),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Define acceleration
|
| 11 |
+
num_workers = 4
|
| 12 |
+
dtype = "bf16"
|
| 13 |
+
grad_checkpoint = True
|
| 14 |
+
plugin = "zero2"
|
| 15 |
+
sp_size = 1
|
| 16 |
+
|
| 17 |
+
# Define model
|
| 18 |
+
model = dict(
|
| 19 |
+
type="STDiT-XL/2",
|
| 20 |
+
space_scale=0.5,
|
| 21 |
+
time_scale=1.0,
|
| 22 |
+
from_pretrained="PixArt-XL-2-512x512.pth",
|
| 23 |
+
enable_flashattn=True,
|
| 24 |
+
enable_layernorm_kernel=True,
|
| 25 |
+
)
|
| 26 |
+
mask_ratios = {
|
| 27 |
+
"mask_no": 0.7,
|
| 28 |
+
"mask_random": 0.15,
|
| 29 |
+
"mask_head": 0.05,
|
| 30 |
+
"mask_tail": 0.05,
|
| 31 |
+
"mask_head_tail": 0.05,
|
| 32 |
+
}
|
| 33 |
+
vae = dict(
|
| 34 |
+
type="VideoAutoencoderKL",
|
| 35 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 36 |
+
)
|
| 37 |
+
text_encoder = dict(
|
| 38 |
+
type="t5",
|
| 39 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 40 |
+
model_max_length=120,
|
| 41 |
+
shardformer=True,
|
| 42 |
+
)
|
| 43 |
+
scheduler = dict(
|
| 44 |
+
type="iddpm",
|
| 45 |
+
timestep_respacing="",
|
| 46 |
+
)
|
| 47 |
+
|
| 48 |
+
# Others
|
| 49 |
+
seed = 42
|
| 50 |
+
outputs = "outputs"
|
| 51 |
+
wandb = False
|
| 52 |
+
|
| 53 |
+
epochs = 1000
|
| 54 |
+
log_every = 10
|
| 55 |
+
ckpt_every = 1000
|
| 56 |
+
load = None
|
| 57 |
+
|
| 58 |
+
batch_size = 8
|
| 59 |
+
lr = 2e-5
|
| 60 |
+
grad_clip = 1.0
|
configs/opensora/train/16x256x256-spee.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=16,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(256, 256),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Define acceleration
|
| 11 |
+
num_workers = 4
|
| 12 |
+
dtype = "bf16"
|
| 13 |
+
grad_checkpoint = True
|
| 14 |
+
plugin = "zero2"
|
| 15 |
+
sp_size = 1
|
| 16 |
+
|
| 17 |
+
# Define model
|
| 18 |
+
model = dict(
|
| 19 |
+
type="STDiT-XL/2",
|
| 20 |
+
space_scale=0.5,
|
| 21 |
+
time_scale=1.0,
|
| 22 |
+
from_pretrained="PixArt-XL-2-512x512.pth",
|
| 23 |
+
enable_flashattn=True,
|
| 24 |
+
enable_layernorm_kernel=True,
|
| 25 |
+
)
|
| 26 |
+
mask_ratios = {
|
| 27 |
+
"mask_no": 0.5,
|
| 28 |
+
"mask_random": 0.29,
|
| 29 |
+
"mask_head": 0.07,
|
| 30 |
+
"mask_tail": 0.07,
|
| 31 |
+
"mask_head_tail": 0.07,
|
| 32 |
+
}
|
| 33 |
+
vae = dict(
|
| 34 |
+
type="VideoAutoencoderKL",
|
| 35 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 36 |
+
)
|
| 37 |
+
text_encoder = dict(
|
| 38 |
+
type="t5",
|
| 39 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 40 |
+
model_max_length=120,
|
| 41 |
+
shardformer=True,
|
| 42 |
+
)
|
| 43 |
+
scheduler = dict(
|
| 44 |
+
type="iddpm-speed",
|
| 45 |
+
timestep_respacing="",
|
| 46 |
+
)
|
| 47 |
+
|
| 48 |
+
# Others
|
| 49 |
+
seed = 42
|
| 50 |
+
outputs = "outputs"
|
| 51 |
+
wandb = False
|
| 52 |
+
|
| 53 |
+
epochs = 1000
|
| 54 |
+
log_every = 10
|
| 55 |
+
ckpt_every = 1000
|
| 56 |
+
load = None
|
| 57 |
+
|
| 58 |
+
batch_size = 8
|
| 59 |
+
lr = 2e-5
|
| 60 |
+
grad_clip = 1.0
|
configs/opensora/train/16x256x256.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=16,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(256, 256),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Define acceleration
|
| 11 |
+
num_workers = 4
|
| 12 |
+
dtype = "bf16"
|
| 13 |
+
grad_checkpoint = True
|
| 14 |
+
plugin = "zero2"
|
| 15 |
+
sp_size = 1
|
| 16 |
+
|
| 17 |
+
# Define model
|
| 18 |
+
model = dict(
|
| 19 |
+
type="STDiT-XL/2",
|
| 20 |
+
space_scale=0.5,
|
| 21 |
+
time_scale=1.0,
|
| 22 |
+
from_pretrained="PixArt-XL-2-512x512.pth",
|
| 23 |
+
enable_flashattn=True,
|
| 24 |
+
enable_layernorm_kernel=True,
|
| 25 |
+
)
|
| 26 |
+
vae = dict(
|
| 27 |
+
type="VideoAutoencoderKL",
|
| 28 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 29 |
+
)
|
| 30 |
+
text_encoder = dict(
|
| 31 |
+
type="t5",
|
| 32 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 33 |
+
model_max_length=120,
|
| 34 |
+
shardformer=True,
|
| 35 |
+
)
|
| 36 |
+
scheduler = dict(
|
| 37 |
+
type="iddpm",
|
| 38 |
+
timestep_respacing="",
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
# Others
|
| 42 |
+
seed = 42
|
| 43 |
+
outputs = "outputs"
|
| 44 |
+
wandb = False
|
| 45 |
+
|
| 46 |
+
epochs = 1000
|
| 47 |
+
log_every = 10
|
| 48 |
+
ckpt_every = 1000
|
| 49 |
+
load = None
|
| 50 |
+
|
| 51 |
+
batch_size = 8
|
| 52 |
+
lr = 2e-5
|
| 53 |
+
grad_clip = 1.0
|
configs/opensora/train/16x512x512.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=16,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(512, 512),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Define acceleration
|
| 11 |
+
num_workers = 4
|
| 12 |
+
dtype = "bf16"
|
| 13 |
+
grad_checkpoint = True
|
| 14 |
+
plugin = "zero2"
|
| 15 |
+
sp_size = 1
|
| 16 |
+
|
| 17 |
+
# Define model
|
| 18 |
+
model = dict(
|
| 19 |
+
type="STDiT-XL/2",
|
| 20 |
+
space_scale=1.0,
|
| 21 |
+
time_scale=1.0,
|
| 22 |
+
from_pretrained=None,
|
| 23 |
+
enable_flashattn=True,
|
| 24 |
+
enable_layernorm_kernel=True,
|
| 25 |
+
)
|
| 26 |
+
vae = dict(
|
| 27 |
+
type="VideoAutoencoderKL",
|
| 28 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 29 |
+
micro_batch_size=128,
|
| 30 |
+
)
|
| 31 |
+
text_encoder = dict(
|
| 32 |
+
type="t5",
|
| 33 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 34 |
+
model_max_length=120,
|
| 35 |
+
shardformer=True,
|
| 36 |
+
)
|
| 37 |
+
scheduler = dict(
|
| 38 |
+
type="iddpm",
|
| 39 |
+
timestep_respacing="",
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# Others
|
| 43 |
+
seed = 42
|
| 44 |
+
outputs = "outputs"
|
| 45 |
+
wandb = False
|
| 46 |
+
|
| 47 |
+
epochs = 1000
|
| 48 |
+
log_every = 10
|
| 49 |
+
ckpt_every = 500
|
| 50 |
+
load = None
|
| 51 |
+
|
| 52 |
+
batch_size = 8
|
| 53 |
+
lr = 2e-5
|
| 54 |
+
grad_clip = 1.0
|
configs/opensora/train/360x512x512.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=360,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(512, 512),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Define acceleration
|
| 11 |
+
num_workers = 4
|
| 12 |
+
dtype = "bf16"
|
| 13 |
+
grad_checkpoint = True
|
| 14 |
+
plugin = "zero2"
|
| 15 |
+
sp_size = 1
|
| 16 |
+
|
| 17 |
+
# Define acceleration
|
| 18 |
+
dtype = "bf16"
|
| 19 |
+
grad_checkpoint = True
|
| 20 |
+
plugin = "zero2-seq"
|
| 21 |
+
sp_size = 2
|
| 22 |
+
|
| 23 |
+
# Define model
|
| 24 |
+
model = dict(
|
| 25 |
+
type="STDiT-XL/2",
|
| 26 |
+
space_scale=1.0,
|
| 27 |
+
time_scale=2 / 3,
|
| 28 |
+
from_pretrained=None,
|
| 29 |
+
enable_flashattn=True,
|
| 30 |
+
enable_layernorm_kernel=True,
|
| 31 |
+
enable_sequence_parallelism=True, # enable sq here
|
| 32 |
+
)
|
| 33 |
+
vae = dict(
|
| 34 |
+
type="VideoAutoencoderKL",
|
| 35 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 36 |
+
micro_batch_size=128,
|
| 37 |
+
)
|
| 38 |
+
text_encoder = dict(
|
| 39 |
+
type="t5",
|
| 40 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 41 |
+
model_max_length=120,
|
| 42 |
+
shardformer=True,
|
| 43 |
+
)
|
| 44 |
+
scheduler = dict(
|
| 45 |
+
type="iddpm",
|
| 46 |
+
timestep_respacing="",
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
# Others
|
| 50 |
+
seed = 42
|
| 51 |
+
outputs = "outputs"
|
| 52 |
+
wandb = False
|
| 53 |
+
|
| 54 |
+
epochs = 1000
|
| 55 |
+
log_every = 10
|
| 56 |
+
ckpt_every = 250
|
| 57 |
+
load = None
|
| 58 |
+
|
| 59 |
+
batch_size = 1
|
| 60 |
+
lr = 2e-5
|
| 61 |
+
grad_clip = 1.0
|
configs/opensora/train/64x512x512-sp.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=16,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(512, 512),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Define acceleration
|
| 11 |
+
num_workers = 4
|
| 12 |
+
dtype = "bf16"
|
| 13 |
+
grad_checkpoint = True
|
| 14 |
+
plugin = "zero2"
|
| 15 |
+
sp_size = 2
|
| 16 |
+
|
| 17 |
+
# Define model
|
| 18 |
+
model = dict(
|
| 19 |
+
type="STDiT-XL/2",
|
| 20 |
+
space_scale=1.0,
|
| 21 |
+
time_scale=2 / 3,
|
| 22 |
+
from_pretrained=None,
|
| 23 |
+
enable_flashattn=True,
|
| 24 |
+
enable_layernorm_kernel=True,
|
| 25 |
+
enable_sequence_parallelism=True, # enable sq here
|
| 26 |
+
)
|
| 27 |
+
vae = dict(
|
| 28 |
+
type="VideoAutoencoderKL",
|
| 29 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 30 |
+
)
|
| 31 |
+
text_encoder = dict(
|
| 32 |
+
type="t5",
|
| 33 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 34 |
+
model_max_length=120,
|
| 35 |
+
shardformer=True,
|
| 36 |
+
)
|
| 37 |
+
scheduler = dict(
|
| 38 |
+
type="iddpm",
|
| 39 |
+
timestep_respacing="",
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# Others
|
| 43 |
+
seed = 42
|
| 44 |
+
outputs = "outputs"
|
| 45 |
+
wandb = False
|
| 46 |
+
|
| 47 |
+
epochs = 1000
|
| 48 |
+
log_every = 10
|
| 49 |
+
ckpt_every = 1000
|
| 50 |
+
load = None
|
| 51 |
+
|
| 52 |
+
batch_size = 1
|
| 53 |
+
lr = 2e-5
|
| 54 |
+
grad_clip = 1.0
|
configs/opensora/train/64x512x512.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=64,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(512, 512),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Define acceleration
|
| 11 |
+
num_workers = 4
|
| 12 |
+
dtype = "bf16"
|
| 13 |
+
grad_checkpoint = True
|
| 14 |
+
plugin = "zero2"
|
| 15 |
+
sp_size = 1
|
| 16 |
+
|
| 17 |
+
# Define model
|
| 18 |
+
model = dict(
|
| 19 |
+
type="STDiT-XL/2",
|
| 20 |
+
space_scale=1.0,
|
| 21 |
+
time_scale=2 / 3,
|
| 22 |
+
from_pretrained=None,
|
| 23 |
+
enable_flashattn=True,
|
| 24 |
+
enable_layernorm_kernel=True,
|
| 25 |
+
)
|
| 26 |
+
vae = dict(
|
| 27 |
+
type="VideoAutoencoderKL",
|
| 28 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 29 |
+
micro_batch_size=64,
|
| 30 |
+
)
|
| 31 |
+
text_encoder = dict(
|
| 32 |
+
type="t5",
|
| 33 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 34 |
+
model_max_length=120,
|
| 35 |
+
shardformer=True,
|
| 36 |
+
)
|
| 37 |
+
scheduler = dict(
|
| 38 |
+
type="iddpm",
|
| 39 |
+
timestep_respacing="",
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# Others
|
| 43 |
+
seed = 42
|
| 44 |
+
outputs = "outputs"
|
| 45 |
+
wandb = False
|
| 46 |
+
|
| 47 |
+
epochs = 1000
|
| 48 |
+
log_every = 10
|
| 49 |
+
ckpt_every = 250
|
| 50 |
+
load = None
|
| 51 |
+
|
| 52 |
+
batch_size = 4
|
| 53 |
+
lr = 2e-5
|
| 54 |
+
grad_clip = 1.0
|
configs/pixart/inference/16x256x256.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 16
|
| 2 |
+
fps = 8
|
| 3 |
+
image_size = (256, 256)
|
| 4 |
+
|
| 5 |
+
# Define model
|
| 6 |
+
model = dict(
|
| 7 |
+
type="PixArt-XL/2",
|
| 8 |
+
space_scale=0.5,
|
| 9 |
+
time_scale=1.0,
|
| 10 |
+
from_pretrained="outputs/098-F16S3-PixArt-XL-2/epoch7-global_step30000/model_ckpt.pt",
|
| 11 |
+
)
|
| 12 |
+
vae = dict(
|
| 13 |
+
type="VideoAutoencoderKL",
|
| 14 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 15 |
+
)
|
| 16 |
+
text_encoder = dict(
|
| 17 |
+
type="t5",
|
| 18 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 19 |
+
model_max_length=120,
|
| 20 |
+
)
|
| 21 |
+
scheduler = dict(
|
| 22 |
+
type="dpm-solver",
|
| 23 |
+
num_sampling_steps=20,
|
| 24 |
+
cfg_scale=7.0,
|
| 25 |
+
)
|
| 26 |
+
dtype = "bf16"
|
| 27 |
+
|
| 28 |
+
# Others
|
| 29 |
+
batch_size = 2
|
| 30 |
+
seed = 42
|
| 31 |
+
prompt_path = "./assets/texts/t2v_samples.txt"
|
| 32 |
+
save_dir = "./samples/samples/"
|
configs/pixart/inference/1x1024MS.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 1
|
| 2 |
+
fps = 1
|
| 3 |
+
image_size = (1920, 512)
|
| 4 |
+
multi_resolution = "PixArtMS"
|
| 5 |
+
|
| 6 |
+
# Define model
|
| 7 |
+
model = dict(
|
| 8 |
+
type="PixArtMS-XL/2",
|
| 9 |
+
space_scale=2.0,
|
| 10 |
+
time_scale=1.0,
|
| 11 |
+
no_temporal_pos_emb=True,
|
| 12 |
+
from_pretrained="PixArt-XL-2-1024-MS.pth",
|
| 13 |
+
)
|
| 14 |
+
vae = dict(
|
| 15 |
+
type="VideoAutoencoderKL",
|
| 16 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 17 |
+
)
|
| 18 |
+
text_encoder = dict(
|
| 19 |
+
type="t5",
|
| 20 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 21 |
+
model_max_length=120,
|
| 22 |
+
)
|
| 23 |
+
scheduler = dict(
|
| 24 |
+
type="dpm-solver",
|
| 25 |
+
num_sampling_steps=20,
|
| 26 |
+
cfg_scale=7.0,
|
| 27 |
+
)
|
| 28 |
+
dtype = "bf16"
|
| 29 |
+
|
| 30 |
+
# Others
|
| 31 |
+
batch_size = 2
|
| 32 |
+
seed = 42
|
| 33 |
+
prompt_path = "./assets/texts/t2i_samples.txt"
|
| 34 |
+
save_dir = "./samples/samples/"
|
configs/pixart/inference/1x256x256.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 1
|
| 2 |
+
fps = 1
|
| 3 |
+
image_size = (256, 256)
|
| 4 |
+
|
| 5 |
+
# Define model
|
| 6 |
+
model = dict(
|
| 7 |
+
type="PixArt-XL/2",
|
| 8 |
+
space_scale=1.0,
|
| 9 |
+
time_scale=1.0,
|
| 10 |
+
no_temporal_pos_emb=True,
|
| 11 |
+
from_pretrained="PixArt-XL-2-256x256.pth",
|
| 12 |
+
)
|
| 13 |
+
vae = dict(
|
| 14 |
+
type="VideoAutoencoderKL",
|
| 15 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 16 |
+
)
|
| 17 |
+
text_encoder = dict(
|
| 18 |
+
type="t5",
|
| 19 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 20 |
+
model_max_length=120,
|
| 21 |
+
)
|
| 22 |
+
scheduler = dict(
|
| 23 |
+
type="dpm-solver",
|
| 24 |
+
num_sampling_steps=20,
|
| 25 |
+
cfg_scale=7.0,
|
| 26 |
+
)
|
| 27 |
+
dtype = "bf16"
|
| 28 |
+
|
| 29 |
+
# Others
|
| 30 |
+
batch_size = 2
|
| 31 |
+
seed = 42
|
| 32 |
+
prompt_path = "./assets/texts/t2i_samples.txt"
|
| 33 |
+
save_dir = "./samples/samples/"
|
configs/pixart/inference/1x512x512.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
num_frames = 1
|
| 2 |
+
fps = 1
|
| 3 |
+
image_size = (512, 512)
|
| 4 |
+
|
| 5 |
+
# Define model
|
| 6 |
+
model = dict(
|
| 7 |
+
type="PixArt-XL/2",
|
| 8 |
+
space_scale=1.0,
|
| 9 |
+
time_scale=1.0,
|
| 10 |
+
no_temporal_pos_emb=True,
|
| 11 |
+
from_pretrained="PixArt-XL-2-512x512.pth",
|
| 12 |
+
)
|
| 13 |
+
vae = dict(
|
| 14 |
+
type="VideoAutoencoderKL",
|
| 15 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 16 |
+
)
|
| 17 |
+
text_encoder = dict(
|
| 18 |
+
type="t5",
|
| 19 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 20 |
+
model_max_length=120,
|
| 21 |
+
)
|
| 22 |
+
scheduler = dict(
|
| 23 |
+
type="dpm-solver",
|
| 24 |
+
num_sampling_steps=20,
|
| 25 |
+
cfg_scale=7.0,
|
| 26 |
+
)
|
| 27 |
+
dtype = "bf16"
|
| 28 |
+
|
| 29 |
+
# prompt_path = "./assets/texts/t2i_samples.txt"
|
| 30 |
+
prompt = [
|
| 31 |
+
"Pirate ship trapped in a cosmic maelstrom nebula.",
|
| 32 |
+
"A small cactus with a happy face in the Sahara desert.",
|
| 33 |
+
"A small cactus with a sad face in the Sahara desert.",
|
| 34 |
+
]
|
| 35 |
+
|
| 36 |
+
# Others
|
| 37 |
+
batch_size = 2
|
| 38 |
+
seed = 42
|
| 39 |
+
save_dir = "./samples/samples/"
|
configs/pixart/train/16x256x256.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=16,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(256, 256),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Define acceleration
|
| 11 |
+
num_workers = 4
|
| 12 |
+
dtype = "bf16"
|
| 13 |
+
grad_checkpoint = True
|
| 14 |
+
plugin = "zero2"
|
| 15 |
+
sp_size = 1
|
| 16 |
+
|
| 17 |
+
# Define model
|
| 18 |
+
model = dict(
|
| 19 |
+
type="PixArt-XL/2",
|
| 20 |
+
space_scale=0.5,
|
| 21 |
+
time_scale=1.0,
|
| 22 |
+
from_pretrained="PixArt-XL-2-512x512.pth",
|
| 23 |
+
enable_flashattn=True,
|
| 24 |
+
enable_layernorm_kernel=True,
|
| 25 |
+
)
|
| 26 |
+
vae = dict(
|
| 27 |
+
type="VideoAutoencoderKL",
|
| 28 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 29 |
+
)
|
| 30 |
+
text_encoder = dict(
|
| 31 |
+
type="t5",
|
| 32 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 33 |
+
model_max_length=120,
|
| 34 |
+
shardformer=True,
|
| 35 |
+
)
|
| 36 |
+
scheduler = dict(
|
| 37 |
+
type="iddpm",
|
| 38 |
+
timestep_respacing="",
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
# Others
|
| 42 |
+
seed = 42
|
| 43 |
+
outputs = "outputs"
|
| 44 |
+
wandb = False
|
| 45 |
+
|
| 46 |
+
epochs = 1000
|
| 47 |
+
log_every = 10
|
| 48 |
+
ckpt_every = 1000
|
| 49 |
+
load = None
|
| 50 |
+
|
| 51 |
+
batch_size = 8
|
| 52 |
+
lr = 2e-5
|
| 53 |
+
grad_clip = 1.0
|
configs/pixart/train/1x512x512.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=1,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(512, 512),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Define acceleration
|
| 11 |
+
num_workers = 4
|
| 12 |
+
dtype = "bf16"
|
| 13 |
+
grad_checkpoint = True
|
| 14 |
+
plugin = "zero2"
|
| 15 |
+
sp_size = 1
|
| 16 |
+
|
| 17 |
+
# Define model
|
| 18 |
+
model = dict(
|
| 19 |
+
type="PixArt-XL/2",
|
| 20 |
+
space_scale=1.0,
|
| 21 |
+
time_scale=1.0,
|
| 22 |
+
no_temporal_pos_emb=True,
|
| 23 |
+
from_pretrained="PixArt-XL-2-512x512.pth",
|
| 24 |
+
enable_flashattn=True,
|
| 25 |
+
enable_layernorm_kernel=True,
|
| 26 |
+
)
|
| 27 |
+
vae = dict(
|
| 28 |
+
type="VideoAutoencoderKL",
|
| 29 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 30 |
+
)
|
| 31 |
+
text_encoder = dict(
|
| 32 |
+
type="t5",
|
| 33 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 34 |
+
model_max_length=120,
|
| 35 |
+
shardformer=True,
|
| 36 |
+
)
|
| 37 |
+
scheduler = dict(
|
| 38 |
+
type="iddpm",
|
| 39 |
+
timestep_respacing="",
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# Others
|
| 43 |
+
seed = 42
|
| 44 |
+
outputs = "outputs"
|
| 45 |
+
wandb = False
|
| 46 |
+
|
| 47 |
+
epochs = 1000
|
| 48 |
+
log_every = 10
|
| 49 |
+
ckpt_every = 1000
|
| 50 |
+
load = None
|
| 51 |
+
|
| 52 |
+
batch_size = 32
|
| 53 |
+
lr = 2e-5
|
| 54 |
+
grad_clip = 1.0
|
configs/pixart/train/64x512x512.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define dataset
|
| 2 |
+
dataset = dict(
|
| 3 |
+
type="VideoTextDataset",
|
| 4 |
+
data_path=None,
|
| 5 |
+
num_frames=64,
|
| 6 |
+
frame_interval=3,
|
| 7 |
+
image_size=(256, 256),
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
# Define acceleration
|
| 11 |
+
num_workers = 4
|
| 12 |
+
dtype = "bf16"
|
| 13 |
+
grad_checkpoint = True
|
| 14 |
+
plugin = "zero2"
|
| 15 |
+
sp_size = 1
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
# Define model
|
| 19 |
+
model = dict(
|
| 20 |
+
type="PixArt-XL/2",
|
| 21 |
+
space_scale=1.0,
|
| 22 |
+
time_scale=2 / 3,
|
| 23 |
+
from_pretrained=None,
|
| 24 |
+
enable_flashattn=True,
|
| 25 |
+
enable_layernorm_kernel=True,
|
| 26 |
+
)
|
| 27 |
+
vae = dict(
|
| 28 |
+
type="VideoAutoencoderKL",
|
| 29 |
+
from_pretrained="stabilityai/sd-vae-ft-ema",
|
| 30 |
+
micro_batch_size=128,
|
| 31 |
+
)
|
| 32 |
+
text_encoder = dict(
|
| 33 |
+
type="t5",
|
| 34 |
+
from_pretrained="DeepFloyd/t5-v1_1-xxl",
|
| 35 |
+
model_max_length=120,
|
| 36 |
+
shardformer=True,
|
| 37 |
+
)
|
| 38 |
+
scheduler = dict(
|
| 39 |
+
type="iddpm",
|
| 40 |
+
timestep_respacing="",
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
# Others
|
| 44 |
+
seed = 42
|
| 45 |
+
outputs = "outputs"
|
| 46 |
+
wandb = False
|
| 47 |
+
|
| 48 |
+
epochs = 1000
|
| 49 |
+
log_every = 10
|
| 50 |
+
ckpt_every = 250
|
| 51 |
+
load = None
|
| 52 |
+
|
| 53 |
+
batch_size = 4
|
| 54 |
+
lr = 2e-5
|
| 55 |
+
grad_clip = 1.0
|