Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: #15650

Open
3 of 6 tasks
AlexysLovesLexxie opened this issue Apr 28, 2024 · 9 comments
Open
3 of 6 tasks

[Bug]: #15650

AlexysLovesLexxie opened this issue Apr 28, 2024 · 9 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@AlexysLovesLexxie
Copy link

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?

Errors when trying to use 4xUltrasharp_4xUltrasharpV10.pt and 4xNMKDSuperscale_4xNMKDSuperscale.pt.

Steps to reproduce the problem

  1. Enter any prompt.
  2. turn on upscaling.
  3. select 4xUltrasharp_4xUltrasharpV10 or 4xNMKDSuperscale_4xNMKDSuperscale from the dropdown menu.
  4. Press "Generate"
  5. watch console output

What should have happened?

Scaler should have loaded and properly executed without error, as per previous versions (I was on 1.7.0 until recently).

What browsers do you use to access the UI ?

Mozilla Firefox, Google Chrome, Brave

Sysinfo

sysinfo-2024-04-28-09-23.json

Console logs

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.9.3
Commit hash: 1c0a0c4c26f78c32095ebc7f8af82f5c04fca8c0
Launching Web UI with arguments: --xformers --api --skip-python-version-check --gradio-allowed-path D:\SM\Data\Images
Loading weights [ce9ee58e2a] from D:\SM\Data\Packages\A1111_193_test\models\Stable-diffusion\animesh_FullV22.safetensors
Creating model from config: D:\SM\Data\Packages\A1111_193_test\configs\v1-inference.yaml
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 11.4s (prepare environment: 2.1s, import torch: 3.5s, import gradio: 0.8s, setup paths: 1.0s, initialize shared: 1.6s, other imports: 0.7s, load scripts: 0.7s, create ui: 0.4s, gradio launch: 0.4s, add APIs: 0.2s).
Applying attention optimization: xformers... done.
Model loaded in 4.3s (load weights from disk: 0.3s, create model: 0.6s, apply weights to model: 2.2s, calculate empty prompt: 0.9s).
100%|██████████| 20/20 [00:04<00:00,  4.54it/s]
*** Unable to load ESRGAN model D:\SM\Data\Packages\A1111_193_test\models\ESRGAN\4xUltrasharp_4xUltrasharpV10.pt
    Traceback (most recent call last):
      File "D:\SM\Data\Packages\A1111_193_test\modules\esrgan_model.py", line 31, in do_upscale
        model = self.load_model(selected_model)
      File "D:\SM\Data\Packages\A1111_193_test\modules\esrgan_model.py", line 49, in load_model
        return modelloader.load_spandrel_model(
      File "D:\SM\Data\Packages\A1111_193_test\modules\modelloader.py", line 150, in load_spandrel_model
        model_descriptor = spandrel.ModelLoader(device=device).load_from_file(str(path))
      File "D:\SM\Data\Packages\A1111_193_test\venv\lib\site-packages\spandrel\__helpers\loader.py", line 41, in load_from_file
        state_dict = self.load_state_dict_from_file(path)
      File "D:\SM\Data\Packages\A1111_193_test\venv\lib\site-packages\spandrel\__helpers\loader.py", line 58, in load_state_dict_from_file
        state_dict = self._load_torchscript(path)
      File "D:\SM\Data\Packages\A1111_193_test\venv\lib\site-packages\spandrel\__helpers\loader.py", line 89, in _load_torchscript
        return torch.jit.load(  # type: ignore
      File "D:\SM\Data\Packages\A1111_193_test\venv\lib\site-packages\torch\jit\_serialization.py", line 162, in load
        cpp_module = torch._C.import_ir_module(cu, str(f), map_location, _extra_files, _restore_shapes)  # type: ignore[call-arg]
    RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

---
100%|██████████| 20/20 [00:21<00:00,  1.08s/it]
Total progress: 100%|██████████| 40/40 [00:29<00:00,  1.36it/s]t]
100%|██████████| 20/20 [00:04<00:00,  4.73it/s]
*** Unable to load ESRGAN model D:\SM\Data\Packages\A1111_193_test\models\ESRGAN\4xNMKDSuperscale_4xNMKDSuperscale.pt
    Traceback (most recent call last):
      File "D:\SM\Data\Packages\A1111_193_test\modules\esrgan_model.py", line 31, in do_upscale
        model = self.load_model(selected_model)
      File "D:\SM\Data\Packages\A1111_193_test\modules\esrgan_model.py", line 49, in load_model
        return modelloader.load_spandrel_model(
      File "D:\SM\Data\Packages\A1111_193_test\modules\modelloader.py", line 150, in load_spandrel_model
        model_descriptor = spandrel.ModelLoader(device=device).load_from_file(str(path))
      File "D:\SM\Data\Packages\A1111_193_test\venv\lib\site-packages\spandrel\__helpers\loader.py", line 41, in load_from_file
        state_dict = self.load_state_dict_from_file(path)
      File "D:\SM\Data\Packages\A1111_193_test\venv\lib\site-packages\spandrel\__helpers\loader.py", line 58, in load_state_dict_from_file
        state_dict = self._load_torchscript(path)
      File "D:\SM\Data\Packages\A1111_193_test\venv\lib\site-packages\spandrel\__helpers\loader.py", line 89, in _load_torchscript
        return torch.jit.load(  # type: ignore
      File "D:\SM\Data\Packages\A1111_193_test\venv\lib\site-packages\torch\jit\_serialization.py", line 162, in load
        cpp_module = torch._C.import_ir_module(cu, str(f), map_location, _extra_files, _restore_shapes)  # type: ignore[call-arg]
    RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

---
100%|██████████| 20/20 [00:21<00:00,  1.08s/it]
Total progress: 100%|██████████| 40/40 [00:28<00:00,  1.40it/s]t]

Additional information

No response

@AlexysLovesLexxie AlexysLovesLexxie added the bug-report Report of a bug, yet to be confirmed label Apr 28, 2024
@w-e-w
Copy link
Collaborator

w-e-w commented Apr 28, 2024

@akx any insight

@akx
Copy link
Collaborator

akx commented Apr 28, 2024

RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

Corrupt download, delete and re-download is my best guess.

@w-e-w
Copy link
Collaborator

w-e-w commented Apr 28, 2024

RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

Corrupt download, delete and re-download is my best guess.

maybe you're right I assume that he's using the same known good file because he wrote

Scaler should have loaded and properly executed without error, as per previous versions (I was on 1.7.0 until recently).

I take this as fine 1.7 but in 1.8 when we switch to spandrel it stoped not working
not sure now

@AlexysLovesLexxie
Copy link
Author

AlexysLovesLexxie commented Apr 28, 2024

RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

Corrupt download, delete and re-download is my best guess.

I'm sorry, I guess I wasn't 100% clear.

This was tested on not one, but two installs of 1.9.3, done days apart. Logs are taken from a minutes-old, fresh, clean install, which I did in order to satisfy the The issue exists on a clean installation of webui checkbox on my report. The two scaler files in question, 4xUltrasharp_4xUltrasharpV10.pt and 4xNMKDSuperscale_4xNMKDSuperscale.pt were copied directly from my 1.7.0 install, which is functioning correctly.

[EDIT] I do not know why it is even mentioning a zip file in the error log - the .pt files aren't zipped, unless there is something I do not understand about the .pt format?

@AlexysLovesLexxie
Copy link
Author

RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

Corrupt download, delete and re-download is my best guess.

maybe you're right I assume that he's using the same known good file because he wrote

Scaler should have loaded and properly executed without error, as per previous versions (I was on 1.7.0 until recently).

I take this as fine 1.7 but in 1.8 when we switch to spandrel it stoped not working not sure now

I skipped from 1.7.0 to 1.9.3 - doing a fresh install, not an update. Then to get the information for this report, I did another fresh, clean install. Copied the previously working .pt files over from my 1.7.0 install.

@akx
Copy link
Collaborator

akx commented Apr 28, 2024

Well, just working off the error message: If the .pt files are actually intact .pt files (i.e. zips) you should be able to rename them to e.g. 4xUltrasharp_4xUltrasharpV10.zip and open them with your favorite archiver. Alternately, if you're on an UNIX system, file 4xUltrasharp_4xUltrasharpV10.pt and/or zipinfo -l 4xUltrasharp_4xUltrasharpV10.pt should show you what they actually are.

It's possible our earlier architecture had been happy loading files with the wrong extension.

@w-e-w
Copy link
Collaborator

w-e-w commented Apr 28, 2024

@w-e-w
Copy link
Collaborator

w-e-w commented Apr 28, 2024

F I think I found the issue
try rename the .pt to .pth
btw I don't think 4xUltrasharp(ESRGAN) are zip files

@AlexysLovesLexxie
Copy link
Author

AlexysLovesLexxie commented Apr 29, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

3 participants