Sygil-Dev / sygil-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
7.86k stars 883 forks source link

[Bug]: Runtime error when attempting image2image with external PNG #510

Closed anorman07 closed 1 year ago

anorman07 commented 2 years ago

What happened?

Runtime error when attempting image2image with external PNG, get this error

"RuntimeError: The size of tensor a (60) must match the size of tensor b (64) at non-singleton dimension 3"

The image is 481 x 481 pixels.

I don't have any problems with images generated internally by text2image. Thanks in advance for your help!

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Chrome

Where are you running the webui?

Windows

Custom settings

No response

Relevant log output

[MemMon] Recording max memory usage...

Iteration: 1/1
Traceback (most recent call last):
  File "C:\Users\anorm\.conda\envs\ldo\lib\site-packages\gradio\routes.py", line 247, in run_predict
    output = await app.blocks.process_api(
  File "C:\Users\anorm\.conda\envs\ldo\lib\site-packages\gradio\blocks.py", line 641, in process_api
    predictions, duration = await self.call_function(fn_index, processed_input)
  File "C:\Users\anorm\.conda\envs\ldo\lib\site-packages\gradio\blocks.py", line 556, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\anorm\.conda\envs\ldo\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\anorm\.conda\envs\ldo\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "C:\Users\anorm\.conda\envs\ldo\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "scripts/webui.py", line 1343, in img2img
    output_images, seed, info, stats = process_images(
  File "scripts/webui.py", line 859, in process_images
    samples_ddim = func_sample(init_data=init_data, x=x, conditioning=c, unconditional_conditioning=uc, sampler_name=sampler_name)
  File "scripts/webui.py", line 1249, in sample
    xi = x0 + noise
RuntimeError: The size of tensor a (60) must match the size of tensor b (64) at non-singleton dimension 3

Code of Conduct

lendrick commented 2 years ago

Generally it resizes the image for you, but maybe that isn't working right now? In any case, it sounds like the work-around is to resize the image yourself to whatever dimensions you have set in the UI. Stable Diffusion can only handle dimensions that are a multiple of 64.