You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/diffusers/models/unet_2d_condition.py
+34-2Lines changed: 34 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,8 @@ class UNet2DConditionModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMixin)
96
96
norm_eps (`float`, *optional*, defaults to 1e-5): The epsilon to use for the normalization.
97
97
cross_attention_dim (`int` or `Tuple[int]`, *optional*, defaults to 1280):
98
98
The dimension of the cross attention features.
99
+
num_transformer_blocks (`int` or `Tuple[int]`, *optional*, defaults to 1):
100
+
The number of transformer blocks of type [`~models.attention.BasicTransformerBlock`]. Only relevant for [`~models.unet_2d_blocks.CrossAttnDownBlock2D`], [`~models.unet_2d_blocks.CrossAttnUpBlock2D`], [`~models.unet_2d_blocks.UNetMidBlock2DCrossAttn`].
99
101
encoder_hid_dim (`int`, *optional*, defaults to None):
100
102
If `encoder_hid_dim_type` is defined, `encoder_hidden_states` will be projected from `encoder_hid_dim`
f"{self.__class__} has the config param `addition_embed_type` set to 'text_time' which requires the keyword argument `text_embeds` to be passed in `added_cond_kwargs`"
812
+
)
813
+
text_embeds=added_cond_kwargs.get("text_embeds")
814
+
if"time_ids"notinadded_cond_kwargs:
815
+
raiseValueError(
816
+
f"{self.__class__} has the config param `addition_embed_type` set to 'text_time' which requires the keyword argument `time_ids` to be passed in `added_cond_kwargs`"
0 commit comments