Skip to content

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

Description

@jonahclarsen

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions