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

Upscaler not working after recent update #1522

Closed
Flonixcorn opened this issue Oct 2, 2022 · 6 comments
Closed

Upscaler not working after recent update #1522

Flonixcorn opened this issue Oct 2, 2022 · 6 comments
Labels
bug Report of a confirmed bug

Comments

@Flonixcorn
Copy link

After the new update implemented Textual Inversion and new upscalers i get errors when upscaling
LDSR and SwinIR 4x work, the others dont do anything, except for upscaling with ESRGAN 4x it gives me this:
Arguments: (0, <PIL.Image.Image image mode=RGB size=512x512 at 0x150C33BBB80>, None, 0, 0, 0, 2, 4, 0, 1) {} Traceback (most recent call last): File "X:\AI\SUPER SD 2.0 Dependencies\stable-diffusion-webui\modules\ui.py", line 182, in f res = list(func(*args, **kwargs)) File "X:\AI\SUPER SD 2.0 Dependencies\stable-diffusion-webui\webui.py", line 59, in f res = func(*args, **kwargs) File "X:\AI\SUPER SD 2.0 Dependencies\stable-diffusion-webui\modules\extras.py", line 85, in run_extras res = upscale(image, extras_upscaler_1, upscaling_resize) File "X:\AI\SUPER SD 2.0 Dependencies\stable-diffusion-webui\modules\extras.py", line 79, in upscale c = upscaler.scaler.upscale(image, resize, upscaler.data_path) File "X:\AI\SUPER SD 2.0 Dependencies\stable-diffusion-webui\modules\upscaler.py", line 61, in upscale img = self.do_upscale(img, selected_model) File "X:\AI\SUPER SD 2.0 Dependencies\stable-diffusion-webui\modules\esrgan_model.py", line 97, in do_upscale model = self.load_model(selected_model) File "X:\AI\SUPER SD 2.0 Dependencies\stable-diffusion-webui\modules\esrgan_model.py", line 115, in load_model pretrained_net = torch.load(filename, map_location='cpu' if has_mps else None) File "X:\AI\SUPER SD 2.0 Dependencies\stable-diffusion-webui\venv\lib\site-packages\torch\serialization.py", line 713, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "X:\AI\SUPER SD 2.0 Dependencies\stable-diffusion-webui\venv\lib\site-packages\torch\serialization.py", line 920, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, '<'.

@d8ahazard
Copy link
Collaborator

Please delete the .pth file in \models\ESRGAN, then try downloading from
https://github.com/cszn/KAIR/releases/download/v1.0/ESRGAN.pth and replace.

I believe the issue is the URL currently being used has suddenly gone bad, so the pth file is invalid.

Submitted #1524 as a resolution.

@d8ahazard
Copy link
Collaborator

This should now be resolved with the latest commit.

@joshistoast
Copy link

joshistoast commented Oct 4, 2022

@d8ahazard Not working for me (latest commit)

@bbecausereasonss
Copy link

Having issues /w SwinIR in latest update, havent tried others>

"Traceback (most recent call last):
File "C:\Users\chlyw\Desktop\Automatic1111\modules\ui.py", line 184, in f
res = list(func(*args, **kwargs))
File "C:\Users\chlyw\Desktop\Automatic1111\webui.py", line 64, in f
res = func(*args, **kwargs)
File "C:\Users\chlyw\Desktop\Automatic1111\modules\img2img.py", line 124, in img2img
processed = modules.scripts.scripts_img2img.run(p, *args)
File "C:\Users\chlyw\Desktop\Automatic1111\modules\scripts.py", line 159, in run
processed = script.run(p, *script_args)
File "C:\Users\chlyw\Desktop\Automatic1111\scripts\sd_upscale.py", line 39, in run
img = upscaler.scaler.upscale(init_img, 2, upscaler.data_path)
File "C:\Users\chlyw\Desktop\Automatic1111\modules\upscaler.py", line 62, in upscale
img = self.do_upscale(img, selected_model)
File "C:\Users\chlyw\Desktop\Automatic1111\modules\swinir_model.py", line 42, in do_upscale
model = self.load_model(model_file)
File "C:\Users\chlyw\Desktop\Automatic1111\modules\swinir_model.py", line 94, in load_model
model.load_state_dict(pretrained_model[params], strict=True)
KeyError: 'params_ema'"

@pomee4
Copy link

pomee4 commented Nov 3, 2022

Having issues /w SwinIR in latest update, havent tried others>

"Traceback (most recent call last): File "C:\Users\chlyw\Desktop\Automatic1111\modules\ui.py", line 184, in f res = list(func(*args, **kwargs)) File "C:\Users\chlyw\Desktop\Automatic1111\webui.py", line 64, in f res = func(*args, **kwargs) File "C:\Users\chlyw\Desktop\Automatic1111\modules\img2img.py", line 124, in img2img processed = modules.scripts.scripts_img2img.run(p, *args) File "C:\Users\chlyw\Desktop\Automatic1111\modules\scripts.py", line 159, in run processed = script.run(p, *script_args) File "C:\Users\chlyw\Desktop\Automatic1111\scripts\sd_upscale.py", line 39, in run img = upscaler.scaler.upscale(init_img, 2, upscaler.data_path) File "C:\Users\chlyw\Desktop\Automatic1111\modules\upscaler.py", line 62, in upscale img = self.do_upscale(img, selected_model) File "C:\Users\chlyw\Desktop\Automatic1111\modules\swinir_model.py", line 42, in do_upscale model = self.load_model(model_file) File "C:\Users\chlyw\Desktop\Automatic1111\modules\swinir_model.py", line 94, in load_model model.load_state_dict(pretrained_model[params], strict=True) KeyError: 'params_ema'"

I'm having the same issue.

@gcp
Copy link

gcp commented Nov 9, 2022

You're probably trying to use Swin2SR (not SwinIR) networks. You need the exact steps here: #2092 (comment)

@mezotaken mezotaken added enhancement New feature or request bug Report of a confirmed bug and removed enhancement New feature or request labels Jan 12, 2023
nne998 pushed a commit to fjteam/stable-diffusion-webui that referenced this issue Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of a confirmed bug
Projects
None yet
Development

No branches or pull requests

7 participants