Repository: stable-diffusion-webui
Issue: The image generated by the paint upload has a black background
Labels: bug-report

### Checklist

- [ ] The issue exists after disabling all extensions
- [ ] The issue exists on a clean installation of webui
- [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
- [ ] The issue exists in the current version of the webui
- [ ] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet

### What happened?
[新建文件夹.zip](https://github.com/AUTOMATIC1111/stable-diffusion-webui/files/15022088/default.zip)


### Steps to reproduce the problem

The file name 880442781713343428183.png mask caused an image problem, while the 806600451713349345060.png mask was generated normally, but there is no significant difference between the two.
The first mask is generated through Cavas on the iPhone 12 phone

### What should have happened?
API passed in parameters
{
  "prompt": "white cylindrical in a snowflake,Cherry blossom tree,FelinkAI,translucent glasszbrush,Sakura and gold style, anime aestheticsfurry art, pink , elaborate, 3d,c4drendering,8k, super high detail, <lora:20240119-1705594619950:1>",
  "negative_prompt": "nsfw,logo,text,badhandv4,EasyNegative,ng_deepnegative_v1_75t,rev2-badprompt,verybadimagenegative_v1.3,negative_hand-neg,mutated hands and fingers,poorly drawn face,extra limb,missing limb,disconnected limbs,malformed hands,ugly",
  "styles": [],
  "seed": -1,
  "subseed": -1,
  "subseed_strength": 0,
  "seed_resize_from_h": -1,
  "seed_resize_from_w": -1,
  "sampler_name": "DPM++ 2M Karras",
  "batch_size": 1,
  "n_iter": 1,
  "steps": 30,
  "cfg_scale": 7,
  "width": 1024,
  "height": 1024,
  "restore_faces": true,
  "tiling": true,
  "do_not_save_samples": false,
  "do_not_save_grid": false,
  "eta": 0,
  "denoising_strength": 1,
  "s_min_uncond": 0,
  "s_churn": 0,
  "s_tmax": 0,
  "s_tmin": 0,
  "s_noise": 0,
  "override_settings": {},
  "override_settings_restore_afterwards": true,
  "refiner_checkpoint": "",
  "refiner_switch_at": 0,
  "disable_extra_networks": false,
  "firstpass_image": "",
  "comments": {},
  "init_images": [
    "https://watermarkud.obs.cn-east-3.myhuaweicloud.com/input/2024/04/17/16/262142511713343427683.png"
  ],
  "resize_mode": 0,
  "image_cfg_scale": 0,
  "mask": "https://watermarkud.obs.cn-east-3.myhuaweicloud.com/input/2024/04/17/16/880442781713343428183.png",
  "mask_blur_x": 4,
  "mask_blur_y": 4,
  "mask_blur": 0,
  "mask_round": true,
  "inpainting_fill": 0,
  "inpaint_full_res": true,
  "inpaint_full_res_padding": 0,
  "inpainting_mask_invert": 0,
  "initial_noise_multiplier": 0,
  "latent_mask": "",
  "force_task_id": "",
  "sampler_index": "DPM++ 2M Karras",
  "include_init_images": false,
  "script_name": "",
  "script_args": [],
  "send_images": true,
  "save_images": false,
  "alwayson_scripts": {},
  "infotext": ""
}

### What browsers do you use to access the UI ?

_No response_

### Sysinfo

I am using version 1.8 of sdwebui
Deployed on Windows system, using 3090 GPU

### Console logs

```Shell
*** API error: POST: http://116.211.238.55:17862/sdapi/v1/img2img {'error': 'ValueError', 'detail': '', 'body': '', 'errors': "Coordinate 'right' is less than 'left'"}
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\anyio\streams\memory.py", line 98, in receive
        return self.receive_nowait()
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\anyio\streams\memory.py", line 93, in receive_nowait
        raise WouldBlock
    anyio.WouldBlock

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\middleware\base.py", line 78, in call_next
        message = await recv_stream.receive()
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\anyio\streams\memory.py", line 118, in receive
        raise EndOfStream
    anyio.EndOfStream

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "D:\stable-diffusion-webui-1.8\modules\api\api.py", line 187, in exception_handling
        return await call_next(request)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\middleware\base.py", line 84, in call_next
        raise app_exc
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\middleware\base.py", line 70, in coro
        await self.app(scope, receive_or_disconnect, send_no_error)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\middleware\base.py", line 108, in __call__
        response = await self.dispatch_func(request, call_next)
      File "D:\stable-diffusion-webui-1.8\modules\api\api.py", line 151, in log_and_time
        res: Response = await call_next(req)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\middleware\base.py", line 84, in call_next
        raise app_exc
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\middleware\base.py", line 70, in coro
        await self.app(scope, receive_or_disconnect, send_no_error)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\middleware\cors.py", line 84, in __call__
        await self.app(scope, receive, send)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\middleware\gzip.py", line 26, in __call__
        await self.app(scope, receive, send)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
        raise exc
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
        await self.app(scope, receive, sender)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__
        raise e
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__
        await self.app(scope, receive, send)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\routing.py", line 718, in __call__
        await route.handle(scope, receive, send)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\routing.py", line 276, in handle
        await self.app(scope, receive, send)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\routing.py", line 66, in app
        response = await func(request)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\fastapi\routing.py", line 237, in app
        raw_response = await run_endpoint_function(
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\fastapi\routing.py", line 165, in run_endpoint_function
        return await run_in_threadpool(dependant.call, **values)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\starlette\concurrency.py", line 41, in run_in_threadpool
        return await anyio.to_thread.run_sync(func, *args)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
        return await get_asynclib().run_sync_in_worker_thread(
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
        return await future
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
        result = context.run(func, *args)
      File "D:\stable-diffusion-webui-1.8\modules\api\api.py", line 548, in img2imgapi
        processed = process_images(p)
      File "D:\stable-diffusion-webui-1.8\modules\processing.py", line 793, in process_images
        res = process_images_inner(p)
      File "D:\stable-diffusion-webui-1.8\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 59, in processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
      File "D:\stable-diffusion-webui-1.8\modules\processing.py", line 863, in process_images_inner
        p.init(p.all_prompts, p.all_seeds, p.all_subseeds)
      File "D:\stable-diffusion-webui-1.8\modules\processing.py", line 1564, in init
        mask = mask.crop(crop_region)
      File "D:\stable-diffusion-webui-1.8\venv\lib\site-packages\PIL\Image.py", line 1224, in crop
        raise ValueError(msg)
    ValueError: Coordinate 'right' is less than 'left'
```


### Additional information

_No response_