AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: (linux) fine-grained sizing in inpainting not working #9850

Open CamelliasW opened 1 year ago

CamelliasW commented 1 year ago

Is there an existing issue for this?

What happened?

image image

use Inpaint ,img size 416*319 has error

in cmd :

Error completing request:24, 1.75it/s] Arguments: ('task(pyvb682f9wq4qex)', 2, 'blue skirt', '', [], None, None, {'image': <PIL.Image.Image image mode=RGBA size=416x391 at 0x7FC5402F9E70>, 'mask': <PIL.PngImagePlugin.PngImageFile image mode=RGBA size=416x391 at 0x7FC5402FBBB0>}, None, None, None, None, 30, 16, 4, 0, 1, False, False, 1, 1, 9, 1.5, 0.5, -1.0, -1.0, 0, 0, 0, False, 391, 416, 0, 0, 32, 0, '', '', '', [], 0, <scripts.external_code.ControlNetUnit object at 0x7fc54029fa00>, '

\n', True, True, '', '', True, 50, True, 1, 0, False, 4, 0.5, 'Linear', 'None', '

Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8

', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', 0, False, False, '', '

Will upscale the image by the selected scale factor; use width and height sliders to set tile size

', 64, 0, 2, 1, '', 0, '', 0, '', True, False, False, False, 0, None, False, 50) {} Traceback (most recent call last): File "/home/ubuntu/stable-diffusion-webui/modules/call_queue.py", line 56, in f res = list(func(*args, *kwargs)) File "/home/ubuntu/stable-diffusion-webui/modules/call_queue.py", line 37, in f res = func(args, **kwargs) File "/home/ubuntu/stable-diffusion-webui/modules/img2img.py", line 172, in img2img processed = process_images(p) File "/home/ubuntu/stable-diffusion-webui/modules/processing.py", line 503, in process_images res = process_images_inner(p) File "/home/ubuntu/stable-diffusion-webui/modules/processing.py", line 711, in process_images_inner image_mask_composite = Image.composite(image.convert('RGBA').convert('RGBa'), Image.new('RGBa', image.size), p.mask_for_overlay.convert('L')).convert('RGBA') File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/PIL/Image.py", line 3341, in composite image.paste(image1, None, mask) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/PIL/Image.py", line 1731, in paste self.im.paste(im, box, mask.im) ValueError: images do not match

Steps to reproduce the problem

1.Choose a picture less than 512

  1. click img2img->inpaint ->upload picture
  2. mask
  3. generate

What should have happened?

give a modify Picture

Commit where the problem happens

https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/22bcc7be428c94e9408f589966c2040187245d81

What platforms do you use to access the UI ?

Linux

What browsers do you use to access the UI ?

Google Chrome, Microsoft Edge

Command Line Arguments

cd ~/
stable-diffusion-webui/webui.sh --xformers --api --listen

username :ubuntu

List of extensions

image

Console logs

stable-diffusion-webui/webui.sh --xformers --api --listen

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on ubuntu user
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Python 3.10.9 (main, Mar  1 2023, 18:23:06) [GCC 11.2.0]
Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing requirements for Web UI

Launching Web UI with arguments: --xformers --api --listen
Loading weights [6ce0161689] from /home/ubuntu/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Creating model from config: /home/ubuntu/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(0): 
Model loaded in 3.3s (load weights from disk: 0.2s, create model: 0.5s, apply weights to model: 0.6s, apply half(): 0.4s, load VAE: 1.0s, move model to device: 0.5s).
Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 9.1s (import torch: 0.9s, import gradio: 0.7s, import ldm: 2.5s, other imports: 0.6s, load scripts: 0.7s, load SD checkpoint: 3.4s, create ui: 0.2s).
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:08<00:00,  1.97it/s]
Error completing request███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:03<00:00,  4.63it/s]
Arguments: ('task(3kz6ug4tprhf4bo)', 2, 'blue skirt', '', [], None, None, {'image': <PIL.Image.Image image mode=RGBA size=416x391 at 0x7FBB827A9330>, 'mask': <PIL.PngImagePlugin.PngImageFile image mode=RGBA size=416x391 at 0x7FBB827A94E0>}, None, None, None, None, 30, 16, 4, 0, 1, False, False, 1, 1, 9, 1.5, 0.5, -1.0, -1.0, 0, 0, 0, False, 391, 416, 0, 0, 32, 0, '', '', '', [], 0, <scripts.external_code.ControlNetUnit object at 0x7fbb838fde10>, '<ul>\n<li><code>CFG Scale</code> should be 2 or lower.</li>\n</ul>\n', True, True, '', '', True, 50, True, 1, 0, False, 4, 0.5, 'Linear', 'None', '<p style="margin-bottom:0.75em">Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', 0, False, False, '', '<p style="margin-bottom:0.75em">Will upscale the image by the selected scale factor; use width and height sliders to set tile size</p>', 64, 0, 2, 1, '', 0, '', 0, '', True, False, False, False, 0, None, False, 50) {}
Traceback (most recent call last):
  File "/home/ubuntu/stable-diffusion-webui/modules/call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "/home/ubuntu/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/home/ubuntu/stable-diffusion-webui/modules/img2img.py", line 172, in img2img
    processed = process_images(p)
  File "/home/ubuntu/stable-diffusion-webui/modules/processing.py", line 503, in process_images
    res = process_images_inner(p)
  File "/home/ubuntu/stable-diffusion-webui/modules/processing.py", line 711, in process_images_inner
    image_mask_composite = Image.composite(image.convert('RGBA').convert('RGBa'), Image.new('RGBa', image.size), p.mask_for_overlay.convert('L')).convert('RGBA')
  File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/PIL/Image.py", line 3341, in composite
    image.paste(image1, None, mask)
  File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/PIL/Image.py", line 1731, in paste
    self.im.paste(im, box, mask.im)
ValueError: images do not match

Additional information

No response

CamelliasW commented 1 year ago

use inpaint ,outpaint ,in cmd error

` Traceback (most recent call last): File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/base.py", line 78, in call_next message = await recv_stream.receive() File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/streams/memory.py", line 114, in receive raise EndOfStream anyio.EndOfStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/ubuntu/stable-diffusion-webui/modules/api/api.py", line 145, in exception_handling return await call_next(request) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/base.py", line 84, in call_next raise app_exc File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/base.py", line 70, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/base.py", line 108, in call response = await self.dispatch_func(request, call_next) File "/home/ubuntu/stable-diffusion-webui/modules/api/api.py", line 110, in log_and_time res: Response = await call_next(req) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/base.py", line 84, in call_next raise app_exc File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/base.py", line 70, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 26, in call await self.app(scope, receive, send) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in call raise exc File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in call await self.app(scope, receive, sender) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in call raise e File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/routing.py", line 718, in call await route.handle(scope, receive, send) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle await self.app(scope, receive, send) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/routing.py", line 66, in app response = await func(request) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app raw_response = await run_endpoint_function( File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/fastapi/routing.py", line 165, in run_endpoint_function return await run_in_threadpool(dependant.call, *values) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool return await anyio.to_thread.run_sync(func, args) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run result = context.run(func, *args) File "/home/ubuntu/stable-diffusion-webui/modules/api/api.py", line 374, in img2imgapi processed = process_images(p) File "/home/ubuntu/stable-diffusion-webui/modules/processing.py", line 503, in process_images res = process_images_inner(p) File "/home/ubuntu/stable-diffusion-webui/modules/processing.py", line 711, in process_images_inner image_mask_composite = Image.composite(image.convert('RGBA').convert('RGBa'), Image.new('RGBa', image.size), p.mask_for_overlay.convert('L')).convert('RGBA') File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/PIL/Image.py", line 3341, in composite image.paste(image1, None, mask) File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/PIL/Image.py", line 1731, in paste self.im.paste(im, box, mask.im) ValueError: images do not match `

CamelliasW commented 1 year ago

in processing.py line :711

                    if p.mask_for_overlay.mode != 'L':
                        p.mask_for_overlay = p.mask_for_overlay.convert('L')
                    if image.mode != 'RGBA':
                        image = image.convert('RGBA')
                    if image.size != p.mask_for_overlay.size:
                        p.mask_for_overlay = p.mask_for_overlay.resize(image.size)
                    image_mask_composite = Image.alpha_composite(image, p.mask_for_overlay.convert('RGBA')).convert('RGBA')