SpenserCai / sd-webui-deoldify

DeOldify for Stable Diffusion WebUI:This is an extension for StableDiffusion's AUTOMATIC1111 web-ui that allows colorize of old photos and old video. It is based on deoldify.
GNU Affero General Public License v3.0
628 stars 29 forks source link

image deoldify throws error: "RuntimeError: unexpected EOF, expected 21676130 more bytes. The file might be corrupted." #49

Open spinferno opened 8 months ago

spinferno commented 8 months ago

Hi, I get the error "RuntimeError: unexpected EOF, expected 21676130 more bytes. The file might be corrupted." when i attempt to deoldify an image.

steps to reproduce:

  1. remove the controlnet extension (after much troubleshooting one by one, I notice that deoldify will only respond when this essential extension is removed)
  2. in a1111, navigate to extras > deoldify, add an image to deoldify, leave settings as is.
  3. the following errors result: `INFO:modules.shared_state:Starting job task(b2nnnl3g583i69z) Starting job task(b2nnnl3g583i69z) INFO:modules.shared_state:Starting job extras Starting job extras Error completing request Arguments: ('task(b2nnnl3g583i69z)', 0, <PIL.Image.Image image mode=RGB size=1280x1808 at 0x22985206860>, None, '', '', True, 0, 4, 512, 512, True, '4x_NMKD-SuperscaleV2_46k', 'None', 0, False, 1, False, 1, 0, False, 0.9, 0.15, 0.5, False, False, 384, 768, 4096, 409600, 'Maximize area', 0.1, False, ['Deepbooru'], False, ['Horizontal'], False, 0.5, 0.2, True, 35, False, False) {} Traceback (most recent call last): File "C:\Projects\ai\automatic1111\modules\call_queue.py", line 57, in f res = list(func(*args, kwargs)) File "C:\Projects\ai\automatic1111\modules\call_queue.py", line 36, in f res = func(*args, *kwargs) File "C:\Projects\ai\automatic1111\modules\postprocessing.py", line 132, in run_postprocessing_webui return run_postprocessing(args, kwargs) File "C:\Projects\ai\automatic1111\modules\postprocessing.py", line 73, in run_postprocessing scripts.scripts_postproc.run(initial_pp, args) File "C:\Projects\ai\automatic1111\modules\scripts_postprocessing.py", line 196, in run script.process(single_image, process_args) File "C:\Projects\ai\automatic1111\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 49, in process pp.image = self.process_image(pp.image, render_factor, artistic, pre_decolorization) File "C:\Projects\ai\automatic1111\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 41, in process_image vis = get_image_colorizer(root_folder=Path(paths_internal.models_path),render_factor=render_factor, artistic=artistic) File "C:\Projects\ai\automatic1111\extensions\sd-webui-deoldify\deoldify\visualize.py", line 426, in get_image_colorizer return get_stable_image_colorizer(root_folder=root_folder, render_factor=render_factor) File "C:\Projects\ai\automatic1111\extensions\sd-webui-deoldify\deoldify\visualize.py", line 435, in get_stable_image_colorizer learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name) File "C:\Projects\ai\automatic1111\extensions\sd-webui-deoldify\deoldify\generators.py", line 19, in gen_inference_wide learn.load(weights_name) File "C:\Projects\ai\automatic1111\extensions\sd-webui-deoldify\fastai\basic_train.py", line 271, in load state = torch.load(source, map_location=device) File "C:\Projects\ai\automatic1111\modules\safe.py", line 108, in load return load_with_extra(filename, *args, extra_handler=global_extra_handler, *kwargs) File "C:\Projects\ai\automatic1111\modules\safe.py", line 156, in load_with_extra return unsafe_torch_load(filename, args, kwargs) File "C:\Projects\ai\automatic1111\venv\lib\site-packages\torch\serialization.py", line 815, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "C:\Projects\ai\automatic1111\venv\lib\site-packages\torch\serialization.py", line 1051, in _legacy_load typed_storage._untyped_storage._set_from_file( RuntimeError: unexpected EOF, expected 21676130 more bytes. The file might be corrupted.

INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK" HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK" INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK" HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"`

Note, if i tick 'artistic', then deoldify will work. what does that do and why will it only work with that setting? Why won't it work with controlnet installed?

oudivad commented 8 months ago

I just installed it today and got the same message. On my side, it won't work even if I tick the "artistic" box

saifinamdar commented 7 months ago

Facing the same exact issue.

oudivad commented 7 months ago

Resolved on my side: when I let the backend download the models for me, I end up with corrupt files. Once you download them manually and put it on the right folders, all is OK after a refresh.

image

Before the manual download, the size of these files was like 10% of the final size.