Skip to content

Open-Sora: Democratizing Efficient Video Production for All

Python

config add is_vae

Shen-Chenhuid08d52ea034b
diff --git a/configs/vae_3d/inference/16x256x256.py b/configs/vae_3d/inference/16x256x256.py
index 53e1970..69461df 100644
--- a/configs/vae_3d/inference/16x256x256.py
+++ b/configs/vae_3d/inference/16x256x256.py
@@ -2,6 +2,7 @@ num_frames = 16
frame_interval = 3
fps = 24 // 3
image_size = (256, 256)
+is_vae = True
# Define dataset
root = None
diff --git a/opensora/models/vae/README.md b/opensora/models/vae/README.md
index 9757214..80ec187 100644
--- a/opensora/models/vae/README.md
+++ b/opensora/models/vae/README.md
@@ -11,5 +11,5 @@ WANDB_API_KEY=<wandb_api_key> CUDA_VISIBLE_DEVICES=<n> torchrun --master_port=<p
### 2. Inference
```yaml
-CUDA_VISIBLE_DEVICES=<n> torchrun --standalone --nnodes=1 --nproc_per_node=1 scripts/inference-vae.py configs/vae_3d/inference/16x256x256.py --ckpt-path /home/shenchenhui/Open-Sora-dev/outputs/028-F16S3-VAE_3D/epoch3-global_step20000/vae --vae-only True --data-path /home/shenchenhui/data/pexels/test.csv
+CUDA_VISIBLE_DEVICES=<n> torchrun --standalone --nnodes=1 --nproc_per_node=1 scripts/inference-vae.py configs/vae_3d/inference/16x256x256.py --ckpt-path /home/shenchenhui/Open-Sora-dev/outputs/028-F16S3-VAE_3D/epoch3-global_step20000/vae --data-path /home/shenchenhui/data/pexels/test.csv
```
\ No newline at end of file
diff --git a/opensora/utils/config_utils.py b/opensora/utils/config_utils.py
index 69e6420..ae5713e 100644
--- a/opensora/utils/config_utils.py
+++ b/opensora/utils/config_utils.py
@@ -32,8 +32,7 @@ def parse_args(training=False):
parser.add_argument("--prompt-path", default=None, type=str, help="path to prompt txt file")
parser.add_argument("--save-dir", default=None, type=str, help="path to save generated samples")
parser.add_argument("--data-path", default=None, type=str, help="path to data csv")
- parser.add_argument("--vae-only", default=False, type=bool, help="if inference on the vae only")
-
+
# hyperparameters
parser.add_argument("--num-sampling-steps", default=None, type=int, help="sampling steps")
parser.add_argument("--cfg-scale", default=None, type=float, help="balance between cond & uncond")
@@ -60,7 +59,7 @@ def merge_args(cfg, args, training=False):
cfg["reference_path"] = None
if "loop" not in cfg:
cfg["loop"] = 1
- if not cfg["vae-only"] and ("prompt" not in cfg or cfg["prompt"] is None):
+ if not "is_vae" in cfg and ("prompt" not in cfg or cfg["prompt"] is None):
assert cfg["prompt_path"] is not None, "prompt or prompt_path must be provided"
cfg["prompt"] = load_prompts(cfg["prompt_path"])
else: