Repository: stable-diffusion-webui
Issue: [Bug]: OSError: image file is truncated when upscaling
Labels: bug-report

### Checklist

- [X] The issue exists after disabling all extensions
- [X] 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
- [X] The issue exists in the current version of the webui
- [X] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet

### What happened?

Every time I try to upscale several pictures in the Extras tab, it stops with the error : "OSError: image file is truncated".
This never happens when upscaling a single picture.
This never happens with my older installation of webui.
This always happens with my updated installation of webui and with my new fresh installation of webui, so it's something that changed recently.

### Steps to reproduce the problem

1. go to the Extras tab
2. give it a batch of pictures or the url of a folder (tried with many different pictures from different folders)
3. set "RealESRGAN_x4plus_anime_6B.pth" as upscaler 1 and "4x-AnimeSharp-lite.pth" as upscaler 2 with 0.5 visibility
4. click generate

### What should have happened?

not crash

### What browsers do you use to access the UI ?

Mozilla Firefox

### Sysinfo

[sysinfo-2024-01-28-21-44.json](https://github.com/AUTOMATIC1111/stable-diffusion-webui/files/14077799/sysinfo-2024-01-28-21-44.json)


### Console logs

```Shell
venv "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\Scripts\Python.ex
e"
Python 3.10.6 (main, Sep 19 2022, 15:45:37) [MSC v.1933 64 bit (AMD64)]
Version: v1.7.0
Commit hash: cf2772fab0af5573da775e7437e6acdca424f26e
Launching Web UI with arguments: --xformers --skip-torch-cuda-test --medvram-sdx
l
Style database not found: D:\apps\stable-diffusion\webui__automatic1111\webui\st
yles.csv
ControlNet preprocessor location: D:\apps\stable-diffusion\webui__automatic1111\
webui\extensions\sd-webui-controlnet\annotator\downloads
2024-01-28 22:15:27,941 - ControlNet - INFO - ControlNet v1.1.438
2024-01-28 22:15:28,146 - ControlNet - INFO - ControlNet v1.1.438
Loading weights [33a4f66940] from D:\apps\stable-diffusion\webui__automatic1111\
webui\models\Stable-diffusion\1.5\anime kidsmix v10 .safetensors
2024-01-28 22:15:28,837 - ControlNet - INFO - ControlNet UI callback registered.

Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Creating model from config: D:\apps\stable-diffusion\webui__automatic1111\webui\
configs\v1-inference.yaml
Startup time: 21.7s (prepare environment: 0.9s, import torch: 7.3s, import gradi
o: 1.9s, setup paths: 2.1s, initialize shared: 0.4s, other imports: 1.3s, setup
codeformer: 0.4s, list SD models: 0.6s, load scripts: 5.2s, create ui: 0.9s, gra
dio launch: 0.6s).
Loading VAE weights specified in settings: D:\apps\stable-diffusion\webui__autom
atic1111\webui\models\VAE\1.5\vae-ft-mse-840000-ema-pruned.pt
Applying attention optimization: xformers... done.
Model loaded in 16.6s (load weights from disk: 1.4s, create model: 0.5s, apply w
eights to model: 8.0s, load VAE: 3.8s, calculate empty prompt: 2.7s).
*** Error completing request
*** Arguments: ('task(0kdzd7xu3ttzmv1)', 1, <PIL.Image.Image image mode=RGB size
=1267x1894 at 0xC7DA5F90>, [<tempfile._TemporaryFileWrapper object at 0x00000000
C53FD780>, <tempfile._TemporaryFileWrapper object at 0x000000007D048B80>, <tempf
ile._TemporaryFileWrapper object at 0x00000000C24261D0>, <tempfile._TemporaryFil
eWrapper object at 0x00000000C53FD5A0>, <tempfile._TemporaryFileWrapper object a
t 0x000000016BAC3970>, <tempfile._TemporaryFileWrapper object at 0x000000016BAC3
2E0>, <tempfile._TemporaryFileWrapper object at 0x000000016BAC3610>, <tempfile._
TemporaryFileWrapper object at 0x000000016BAC33D0>], '', '', True, 0, 2, 512, 51
2, True, 'upscale and clean anime _ RealESRGAN_x4plus_anime_6B', 'upscale and cl
ean anime _ 4x-AnimeSharp-lite', 0.5, False, 1, False, 1, 0, False, 0.9, 0.15, 0
.5, False, False, 384, 768, 4096, 409600, 'Maximize area', 0.1, False, ['Deepboo
ru'], False, ['Horizontal'], False, 0.5, 0.2) {}
    Traceback (most recent call last):
      File "D:\apps\stable-diffusion\webui__automatic1111\webui\modules\call_que
ue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "D:\apps\stable-diffusion\webui__automatic1111\webui\modules\call_que
ue.py", line 36, in f
        res = func(*args, **kwargs)
      File "D:\apps\stable-diffusion\webui__automatic1111\webui\modules\postproc
essing.py", line 132, in run_postprocessing_webui
        return run_postprocessing(*args, **kwargs)
      File "D:\apps\stable-diffusion\webui__automatic1111\webui\modules\postproc
essing.py", line 71, in run_postprocessing
        initial_pp = scripts_postprocessing.PostprocessedImage(image_data.conver
t("RGB"))
      File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\PIL\Image.py", line 933, in convert
        self.load()
      File "D:\apps\stable-diffusion\webui__automatic1111\webui\venv\lib\site-pa
ckages\PIL\ImageFile.py", line 266, in load
        raise OSError(msg)
    OSError: image file is truncated (1 bytes not processed)

---
```


### Additional information

_No response_