diff --git a/.gitignore b/.gitignore index 48d7e77d4..4376ff278 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,5 @@ hw* 257f* 513f* taming* -221hw* \ No newline at end of file +221hw* +65x512x512 \ No newline at end of file diff --git a/opensora/models/diffusion/latte/modeling_latte.py b/opensora/models/diffusion/latte/modeling_latte.py index fa8ed7192..7a5706b20 100644 --- a/opensora/models/diffusion/latte/modeling_latte.py +++ b/opensora/models/diffusion/latte/modeling_latte.py @@ -401,7 +401,7 @@ class LatteT2V(ModelMixin, ConfigMixin): encoder_hidden_states = torch.cat([encoder_hidden_states_video, encoder_hidden_states_image], dim=1) encoder_hidden_states_spatial = rearrange(encoder_hidden_states, 'b f t d -> (b f) t d').contiguous() else: - encoder_hidden_states_spatial = repeat(encoder_hidden_states, 'b t d -> (b f) t d', f=frame).contiguous() + encoder_hidden_states_spatial = repeat(encoder_hidden_states, 'b 1 t d -> (b f) t d', f=frame).contiguous() # prepare timesteps for spatial and temporal block timestep_spatial = repeat(timestep, 'b d -> (b f) d', f=frame + use_image_num).contiguous() diff --git a/opensora/sample/pipeline_videogen.py b/opensora/sample/pipeline_videogen.py index ce63b2f57..1263473fa 100644 --- a/opensora/sample/pipeline_videogen.py +++ b/opensora/sample/pipeline_videogen.py @@ -705,6 +705,10 @@ class VideoGenPipeline(DiffusionPipeline): # broadcast to batch dimension in a way that's compatible with ONNX/Core ML current_timestep = current_timestep.expand(latent_model_input.shape[0]) + if prompt_embeds.ndim == 3: + prompt_embeds = prompt_embeds.unsqueeze(1) # b l d -> b 1 l d + # if prompt_attention_mask.ndim == 2: + # prompt_attention_mask = prompt_attention_mask.unsqueeze(1) # b l -> b 1 l # predict noise model_output noise_pred = self.transformer( latent_model_input,