Repository: stable-diffusion-webui
Issue: [Bug]: (linux) fine-grained sizing in inpainting not working
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

![image](https://user-images.githubusercontent.com/16435275/233971969-52096634-ebf0-4d9a-85b2-b695e3242f64.png)
![image](https://user-images.githubusercontent.com/16435275/233972111-d2a21feb-746d-4a29-b9fa-fb5ff68b4cfb.png)

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>, '<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


### Steps to reproduce the problem

1.Choose a picture less than 512
2. click img2img->inpaint ->upload picture 
3. mask
4. 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

```Shell
cd ~/
stable-diffusion-webui/webui.sh --xformers --api --listen

username :ubuntu
```


### List of extensions



![image](https://user-images.githubusercontent.com/16435275/234151958-8897b4c6-19ad-49a0-9562-28a643f3a145.png)









### Console logs

```Shell
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_