Skip to content
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

AsymmetricAutoencoderKL: missing generator argument in decode() called from forward() #8317

Closed
townwish4git opened this issue May 30, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@townwish4git
Copy link
Contributor

townwish4git commented May 30, 2024

Describe the bug

AsymmetricAutoencoderKL.decode() has parameter generator,

def decode(
        self,
        z: torch.FloatTensor,
        generator: Optional[torch.Generator] = None,
        image: Optional[torch.FloatTensor] = None,
        mask: Optional[torch.FloatTensor] = None,
        return_dict: bool = True,
    ) -> Union[DecoderOutput, Tuple[torch.FloatTensor]]:
    ...

But when forward() calls self.decode(), only three positional arguments are passed in,

...
dec = self.decode(z, sample, mask).sample
...

which means:

  1. argument z => parameter z;
  2. argument sample => parameter generator;
  3. argument mask => parameter image;
  4. default None => parameter mask

it appears to be a bug and should be corrected to

- dec = self.decode(z, sample, mask).sample
+ dec = self.decode(z, generator, sample, mask).sample

Reproduction

from diffusers import AsymmetricAutoencoderKL

...

Logs

No response

System Info

Environment-independent

Who can help?

@sayakpaul @DN6 @yiyixuxu @cross-attention

@townwish4git townwish4git added the bug Something isn't working label May 30, 2024
@townwish4git townwish4git changed the title AsymmetricAutoencoderKL: unused generator parameter in decode() AsymmetricAutoencoderKL: missing generator argument of decode() called from forward() May 31, 2024
@townwish4git townwish4git changed the title AsymmetricAutoencoderKL: missing generator argument of decode() called from forward() AsymmetricAutoencoderKL: missing generator argument in decode() called from forward() May 31, 2024
@sayakpaul
Copy link
Member

Thanks for opening this issue. Would you like to take a stab at opening a PR to fix this?

@townwish4git
Copy link
Contributor Author

Thanks for opening this issue. Would you like to take a stab at opening a PR to fix this?

Yes of course. Here is #8378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants