Skip to content

Commit b3a5150

Browse files
committed
Fix stable_video_diffusion
1 parent 8ee10d8 commit b3a5150

4 files changed

Lines changed: 134 additions & 88 deletions

File tree

src/diffusers/models/unets/unet_spatio_temporal_condition.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def __init__(
114114
f"Must provide the same number of `num_attention_heads` as `down_block_types`. `num_attention_heads`: {num_attention_heads}. `down_block_types`: {down_block_types}."
115115
)
116116

117-
if isinstance(cross_attention_dim, list) and len(cross_attention_dim) != len(down_block_types):
117+
if not isinstance(cross_attention_dim, int) and len(cross_attention_dim) != len(down_block_types):
118118
raise ValueError(
119119
f"Must provide the same number of `cross_attention_dim` as `down_block_types`. `cross_attention_dim`: {cross_attention_dim}. `down_block_types`: {down_block_types}."
120120
)
@@ -124,6 +124,13 @@ def __init__(
124124
f"Must provide the same number of `layers_per_block` as `down_block_types`. `layers_per_block`: {layers_per_block}. `down_block_types`: {down_block_types}."
125125
)
126126

127+
if not isinstance(transformer_layers_per_block, int) and len(transformer_layers_per_block) != len(
128+
down_block_types
129+
):
130+
raise ValueError(
131+
f"Must provide the same number of `transformer_layers_per_block` as `down_block_types`. `transformer_layers_per_block`: {transformer_layers_per_block}. `down_block_types`: {down_block_types}."
132+
)
133+
127134
# input
128135
self.conv_in = nn.Conv2d(
129136
in_channels,

0 commit comments

Comments
 (0)