From aca46ea2093f5162210baeab94527a5c9503b865 Mon Sep 17 00:00:00 2001 From: Stepheni12 Date: Tue, 20 Feb 2024 01:23:41 -0500 Subject: [PATCH 1/3] pass linear projection parameter to mid block --- src/diffusers/models/unets/unet_motion_model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/diffusers/models/unets/unet_motion_model.py b/src/diffusers/models/unets/unet_motion_model.py index 9cb0f42c85ef..8538ab26f3d2 100644 --- a/src/diffusers/models/unets/unet_motion_model.py +++ b/src/diffusers/models/unets/unet_motion_model.py @@ -306,6 +306,7 @@ def __init__( num_attention_heads=num_attention_heads[-1], resnet_groups=norm_num_groups, dual_cross_attention=False, + use_linear_projection=use_linear_projection, temporal_num_attention_heads=motion_num_attention_heads, temporal_max_seq_length=motion_max_seq_length, ) @@ -321,6 +322,7 @@ def __init__( num_attention_heads=num_attention_heads[-1], resnet_groups=norm_num_groups, dual_cross_attention=False, + use_linear_projection=use_linear_projection, ) # count how many layers upsample the images From 00c2c4ddb82cc5c005ff8f33a7ba7f398b86af7a Mon Sep 17 00:00:00 2001 From: Stepheni12 Date: Thu, 22 Feb 2024 18:19:53 -0500 Subject: [PATCH 2/3] add cond_proj_dim to motion UNet --- src/diffusers/models/unets/unet_motion_model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/diffusers/models/unets/unet_motion_model.py b/src/diffusers/models/unets/unet_motion_model.py index 8538ab26f3d2..3abba2d9208d 100644 --- a/src/diffusers/models/unets/unet_motion_model.py +++ b/src/diffusers/models/unets/unet_motion_model.py @@ -217,6 +217,7 @@ def __init__( use_motion_mid_block: int = True, encoder_hid_dim: Optional[int] = None, encoder_hid_dim_type: Optional[str] = None, + time_cond_proj_dim: Optional[int] = None, ): super().__init__() @@ -255,6 +256,7 @@ def __init__( timestep_input_dim, time_embed_dim, act_fn=act_fn, + cond_proj_dim=time_cond_proj_dim ) if encoder_hid_dim_type is None: From e49bfbd8e2784ece87d344bb909bb1abc7367f68 Mon Sep 17 00:00:00 2001 From: Stepheni12 Date: Thu, 22 Feb 2024 18:35:24 -0500 Subject: [PATCH 3/3] run style and quality checks --- src/diffusers/models/unets/unet_motion_model.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/diffusers/models/unets/unet_motion_model.py b/src/diffusers/models/unets/unet_motion_model.py index 3abba2d9208d..246a4b8124d8 100644 --- a/src/diffusers/models/unets/unet_motion_model.py +++ b/src/diffusers/models/unets/unet_motion_model.py @@ -253,10 +253,7 @@ def __init__( timestep_input_dim = block_out_channels[0] self.time_embedding = TimestepEmbedding( - timestep_input_dim, - time_embed_dim, - act_fn=act_fn, - cond_proj_dim=time_cond_proj_dim + timestep_input_dim, time_embed_dim, act_fn=act_fn, cond_proj_dim=time_cond_proj_dim ) if encoder_hid_dim_type is None: