Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/diffusers/models/unets/unet_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(
# time
if time_embedding_type == "fourier":
self.time_proj = GaussianFourierProjection(
embedding_size=8, set_W_to_weight=False, log=False, flip_sin_to_cos=flip_sin_to_cos
embedding_size=block_out_channels[0], set_W_to_weight=False, log=False, flip_sin_to_cos=flip_sin_to_cos
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a breaking change

)
timestep_input_dim = 2 * block_out_channels[0]
elif time_embedding_type == "positional":
Expand All @@ -114,8 +114,10 @@ def __init__(
in_channels=timestep_input_dim,
time_embed_dim=time_embed_dim,
act_fn=act_fn,
out_dim=block_out_channels[0],
out_dim=time_embed_dim,
)
else:
time_embed_dim = timestep_input_dim

self.down_blocks = nn.ModuleList([])
self.mid_block = None
Expand All @@ -138,7 +140,7 @@ def __init__(
num_layers=layers_per_block,
in_channels=input_channel,
out_channels=output_channel,
temb_channels=block_out_channels[0],
temb_channels=time_embed_dim,
add_downsample=not is_final_block or downsample_each_block,
)
self.down_blocks.append(down_block)
Expand All @@ -149,7 +151,7 @@ def __init__(
in_channels=block_out_channels[-1],
mid_channels=block_out_channels[-1],
out_channels=block_out_channels[-1],
embed_dim=block_out_channels[0],
embed_dim=time_embed_dim,
num_layers=layers_per_block,
add_downsample=downsample_each_block,
)
Expand All @@ -175,7 +177,7 @@ def __init__(
num_layers=layers_per_block,
in_channels=prev_output_channel,
out_channels=output_channel,
temb_channels=block_out_channels[0],
temb_channels=time_embed_dim,
add_upsample=not is_final_block,
)
self.up_blocks.append(up_block)
Expand All @@ -186,7 +188,7 @@ def __init__(
self.out_block = get_out_block(
out_block_type=out_block_type,
num_groups_out=num_groups_out,
embed_dim=block_out_channels[0],
embed_dim=time_embed_dim,
out_channels=out_channels,
act_fn=act_fn,
fc_dim=block_out_channels[-1] // 4,
Expand Down