Skip to content

Commit

Permalink
Make time_embed_dim of UNet2DModel changeable (huggingface#10262)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bichidian authored and Foundsheep committed Dec 23, 2024
1 parent 52bf0d1 commit 58aa775
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/diffusers/models/unets/unet_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def __init__(
out_channels: int = 3,
center_input_sample: bool = False,
time_embedding_type: str = "positional",
time_embedding_dim: Optional[int] = None,
freq_shift: int = 0,
flip_sin_to_cos: bool = True,
down_block_types: Tuple[str, ...] = ("DownBlock2D", "AttnDownBlock2D", "AttnDownBlock2D", "AttnDownBlock2D"),
Expand Down Expand Up @@ -128,7 +129,7 @@ def __init__(
super().__init__()

self.sample_size = sample_size
time_embed_dim = block_out_channels[0] * 4
time_embed_dim = time_embedding_dim or block_out_channels[0] * 4

# Check inputs
if len(down_block_types) != len(up_block_types):
Expand Down

0 comments on commit 58aa775

Please sign in to comment.