Repository: stable-diffusion-webui
Issue: [Bug]: Just resize (latent upscale) causes "size of tensors must match..." errors
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?

I keep getting "RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 64 but got size 112 for tensor number 1 in the list" no matter what resolution I try. Here's res's I've tried so far:
1. 512x512
2. 960x896
3. <insert dimension that's a multiple of 64px here>
4. and other random reses

### Steps to reproduce the problem

1. Go to img2img
2. tick the "Just resize (latent upscale)" button
3. try generating with the resolutions listed


### What should have happened?

The image should generate without this error appearing.

### Commit where the problem happens

5ab7f213

### What platforms do you use to access the UI ?

Linux

### What browsers do you use to access the UI ?

Mozilla Firefox

### Command Line Arguments

```Shell
export COMMANDLINE_ARGS="--opt-sdp-attention --theme dark --no-half --medvram --precision full"
```


### List of extensions

1. a1111-sd-webui-tagcomplete 
2. sd-dynamic-prompts

### Console logs

```Shell
cd ~/Desktop/stable-diffusion-webui && ./webui.sh

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on user user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Using TCMalloc: libtcmalloc.so.4
Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0]
Commit hash: 5ab7f213bec2f816f9c5644becb32eb72c8ffb89
Installing requirements
Installing sd-dynamic-prompts requirements.txt

Launching Web UI with arguments: --opt-sdp-attention --theme dark --no-half --medvram --precision full
No module 'xformers'. Proceeding without it.
Loading weights [9140e020d1] from /home/pc/Desktop/stable-diffusion-webui/models/Stable-diffusion/mixProV4-inpainting.inpainting.safetensors
Creating model from config: /home/pc/Desktop/stable-diffusion-webui/configs/v1-inpainting-inference.yaml
LatentInpaintDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.54 M params.
Loading VAE weights specified in settings: /home/pc/Desktop/stable-diffusion-webui/models/VAE/clearvae_main.safetensors
Applying scaled dot product cross attention optimization.
Textual inversion embeddings loaded(0): 
Model loaded in 2.5s (load weights from disk: 0.3s, create model: 0.4s, apply weights to model: 1.5s, load VAE: 0.3s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 6.1s (import torch: 0.9s, import gradio: 0.7s, import ldm: 0.3s, other imports: 0.6s, load scripts: 0.4s, load SD checkpoint: 2.6s, create ui: 0.4s, scripts app_started_callback: 0.1s).
100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:19<00:00,  1.52s/it]
Total progress: 100%|████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:25<00:00,  1.92s/it]
Error completing request█████████████████████████████████████████████████████████████████████████████████| 13/13 [00:25<00:00,  1.33s/it]
Arguments: ('task(6y12m9xtlutks2w)', 0, 'high quality, goku', 'worst quality, low quality, monochrome, greyscale, (muted color, pale color:1.3)', [], <PIL.Image.Image image mode=RGBA size=800x900 at 0x7FD2CFB575B0>, None, None, None, None, None, None, 20, 3, 4, 0, 1, False, False, 1, 1, 7, 1.5, 0.6, -1.0, -1.0, 0, 0, 0, False, 0, 512, 512, 0.65, 3, 0, 32, 0, '', '', '', [], 0, True, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', '<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) {}
Traceback (most recent call last):
  File "/home/pc/Desktop/stable-diffusion-webui/modules/call_queue.py", line 57, in f
    res = list(func(*args, **kwargs))
  File "/home/pc/Desktop/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/home/pc/Desktop/stable-diffusion-webui/modules/img2img.py", line 181, in img2img
    processed = process_images(p)
  File "/home/pc/Desktop/stable-diffusion-webui/modules/processing.py", line 515, in process_images
    res = process_images_inner(p)
  File "/home/pc/Desktop/stable-diffusion-webui/modules/processing.py", line 604, in process_images_inner
    p.init(p.all_prompts, p.all_seeds, p.all_subseeds)
  File "/home/pc/Desktop/stable-diffusion-webui/modules/processing.py", line 1106, in init
    self.image_conditioning = self.img2img_image_conditioning(image, self.init_latent, image_mask)
  File "/home/pc/Desktop/stable-diffusion-webui/modules/processing.py", line 260, in img2img_image_conditioning
    return self.inpainting_image_conditioning(source_image, latent_image, image_mask=image_mask)
  File "/home/pc/Desktop/stable-diffusion-webui/modules/processing.py", line 243, in inpainting_image_conditioning
    image_conditioning = torch.cat([conditioning_mask, conditioning_image], dim=1)
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 64 but got size 112 for tensor number 1 in the list.
```


### Additional information

_No response_