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

Only powers of 2 work for width/height, not multiples of 8 #9

Open
jonahclarsen opened this issue Jan 8, 2023 · 1 comment
Open

Comments

@jonahclarsen
Copy link

Hi there,

I am having trouble generating images with width/heights other than powers of 2. Using the fix mentioned in #1, I can generate images with different dimensions than 512x512, but only 256x256 and 128x128 have worked for me so far.

When I use 248x248 (a multiple of 8) as the width/height, I get the following error:

Generating 1. image.
0it [00:01, ?it/s]
Traceback (most recent call last):
...
File "C:\...\Anaconda3\envs\sd_playground\lib\site-packages\diffusers\models\unet_blocks.py", line 1034, in forward
hidden_states = torch.cat([hidden_states, res_hidden_states], dim=1)
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 32 but got size 31 for tensor number 1 in the list.

For 224x224 (a multiple of 32), I get a similar error but ending in this instead:

RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 8 but got size 7 for tensor number 1 in the list.

Any help would be greatly appreciated.

Also, I keep getting NSFW content detected at low resolutions (especially 128x128), even with the default prompt. Is there a way to disable the NSFW filter?

@jonahclarsen
Copy link
Author

jonahclarsen commented Jan 10, 2023

For some reason, as I mentioned in #5, I was able to do 640x512 as well, but not 648x512. So maybe it needs to be a multiple of 128 rather than 8...

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

No branches or pull requests

1 participant