Sygil-Dev / stable-diffusion

GNU Affero General Public License v3.0
1.72k stars 149 forks source link

Resize mode in img2img : tensor size error #200

Closed Guizmus closed 2 years ago

Guizmus commented 2 years ago

Using the webUI, in the img2img module, I get systematic tensor size error in a runtime error if the init picture needs resizing. not the same error as #147 displays so I put this in another issue.

Here is an init image and prompt that do keep generating the error, as well as a screenshot of the error. unknown A tropical island, screenshot from Curse of Monkey Island Game, Lucas Arts, Monkey island, digital artwork, ultra detailed

image

I doubt this would change a lot since the error seems to happen before, but the error appeared on mutiple random seeds, I was using k_euler_a, with defaults webUI settings, to be complete

adamesko commented 2 years ago

I got the same thing - it turns out that you have to set the same resolution as in the source file. It is often not possible to set the exact resolution of the image in the settings so basically you have to prepare your file to match the resolutions that can be set in webui.

Angelore commented 2 years ago

@Guizmus this seems to be a typo, see this comment: https://github.com/hlky/stable-diffusion-webui/issues/398#issuecomment-1233926934 The location of the file in this repo is stable-diffusion-hlky\scripts\webui.py

Guizmus commented 2 years ago

I tried the proposed fix, and it works, at least in the proposed test case. I'll report on #398 too

hlky commented 2 years ago

Pushed major txt2img ui overhaul that has img2img working in my tests Please update and open a new issue if the problem recurs

Angelore commented 2 years ago

RuntimeError: The size of tensor a (128) must match the size of tensor b (96) at non-singleton dimension 3 It's borked again, sir @hlky .

Looks like you didn't update the offending piece of code: https://github.com/hlky/stable-diffusion/blob/main/scripts/webui.py#L1193 The typo is still there (should be "image = image.convert("RGB")")

bbecausereasonss commented 2 years ago

I'm also having this issue now.

Guizmus commented 2 years ago

I tested right now after the last commit (fbf814ebdff6ab08a56b87de947193e602a7918a)

The issue has evolved but is still blocking, I'll open a new issue detailing