Skip to content

fixed bug in defining embed dim for UNet1D #12111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SammyAgrawal
Copy link

What does this PR do?

Fixes #12110

Hi! First time contributor to diffusers, apologies for anything I'm doing wrong in the PR. I noticed what I believe is a very simple and small bug in creating 1D UNets. A value is hardcoded that should not be. I noticed this while trying to debug why my UNet kept giving me shape errors. I just transitioned from using a 2d model to 1d for my personal use case, and this was causing me a headache! I am basically solving my own "Good First Issue" (linked above) noticed during my usage. I believe the Issue itself explains the problem and solution pretty straightforwardly.

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Tagging @sayakpaul @yiyixuxu @DN6

@SammyAgrawal
Copy link
Author

SammyAgrawal commented Aug 10, 2025

I should note that although I tried to follow the contributing doc, there were parts that were hard for me to replicate / understand.
For example, should I not be trying to merge into main? I only saw that my fork branch should not be main.

Will happily go back and fix this before review if asked. For example, I ran python tests/models/unets/test_models_unet_1d.py but it failed with:

Traceback (most recent call last):
  File "/home/jovyan/Samarth/diffusers/tests/models/unets/test_models_unet_1d.py", line 29, in <module>
    from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin
ImportError: attempted relative import with no known parent package

Which is unrelated to my modification. I think this means I set it up wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in initialization of UNet1DModel GaussianFourier time projection
1 participant