Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions opensora/utils/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ def prepare_visual_condition_uncausal(
C = model_ae.cfg.latent_channels
T, H, W = model_ae.get_latent_size(x.shape[-3:])

condition_config = condition_config.copy() # prevent altering the global config when applying local changes

# Initialize masks tensor to match the shape of x, but only the time dimension will be masked
masks = torch.zeros(B, 1, T, H, W).to(
x.device, x.dtype
Expand Down Expand Up @@ -330,6 +332,8 @@ def prepare_visual_condition_causal(x: torch.Tensor, condition_config: dict, mod
C = model_ae.cfg.latent_channels
T, H, W = model_ae.get_latent_size(x.shape[-3:])

condition_config = condition_config.copy() # prevent altering the global config when applying local changes

# Initialize masks tensor to match the shape of x, but only the time dimension will be masked
masks = torch.zeros(B, 1, T, H, W).to(
x.device, x.dtype
Expand Down