stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[Bug]: SD | A1111 | Unable to load face-restoration model
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
- [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?
Hello everyone, I´m new here. I use A1111 with Colab pro, I was using a working version of notebook until the most recent update (https://github.com/TheLastBen/fast-stable-diffusion#fast-stable-diffusion-notebooks-a1111--comfyui--dreambooth), and I got an error shown in the attached image, and I don´t know how to solve it.
Steps to reproduce the problem
- check Hires.fix
- select upscalar ESRGAN_4x and then when I generate the image, I get the error show at the attached images
What should have happened?
I should get sharp upscaled images, but in this case the images are blured
What browsers do you use to access the UI ?
Google Chrome
Sysinfo
Console logs
✔ Connected
Startup time: 8.9s (load scripts: 1.6s, create ui: 1.1s, gradio launch: 5.4s, add APIs: 0.5s).
100% 20/20 [00:10<00:00, 1.93it/s]
Model '/content/gdrive/MyDrive/sd/stable-diffusion-webui/models/ESRGAN/ESRGAN_4x.pth' is not a 'ESRGAN' model (got <spandrel.architectures.ESRGAN.ESRGANArch object at 0x7a151176b850>)
tiled upscale100% 20/20 [00:08<00:00, 2.49it/s]
100% 10/10 [00:47<00:00, 4.70s/it]
Unable to load face-restoration model
Traceback (most recent call last):
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/face_restoration_utils.py", line 150, in restore_with_helper
self.net = self.load_net()
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/codeformer_model.py", line 37, in load_net
return modelloader.load_spandrel_model(
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/modelloader.py", line 150, in load_spandrel_model
model_descriptor = spandrel.ModelLoader(device=device).load_from_file(str(path))
File "/usr/local/lib/python3.10/dist-packages/spandrel/__helpers/loader.py", line 44, in load_from_file
return self.load_from_state_dict(state_dict)
File "/usr/local/lib/python3.10/dist-packages/spandrel/__helpers/loader.py", line 81, in load_from_state_dict
return self.registry.load(state_dict).to(self.device)
File "/usr/local/lib/python3.10/dist-packages/spandrel/__helpers/registry.py", line 184, in load
raise UnsupportedModelError
spandrel.__helpers.registry.UnsupportedModelError
100% 20/20 [00:10<00:00, 1.89it/s]
Model '/content/gdrive/MyDrive/sd/stable-diffusion-webui/models/ESRGAN/ESRGAN_4x.pth' is not a 'ESRGAN' model (got <spandrel.architectures.ESRGAN.ESRGANArch object at 0x7a151176b850>)
tiled upscale100% 20/20 [00:08<00:00, 2.26it/s]
100% 10/10 [00:46<00:00, 4.69s/it]
Unable to load face-restoration model
Traceback (most recent call last):
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/face_restoration_utils.py", line 150, in restore_with_helper
self.net = self.load_net()
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/codeformer_model.py", line 37, in load_net
return modelloader.load_spandrel_model(
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/modelloader.py", line 150, in load_spandrel_model
model_descriptor = spandrel.ModelLoader(device=device).load_from_file(str(path))
File "/usr/local/lib/python3.10/dist-packages/spandrel/__helpers/loader.py", line 44, in load_from_file
return self.load_from_state_dict(state_dict)
File "/usr/local/lib/python3.10/dist-packages/spandrel/__helpers/loader.py", line 81, in load_from_state_dict
return self.registry.load(state_dict).to(self.device)
File "/usr/local/lib/python3.10/dist-packages/spandrel/__helpers/registry.py", line 184, in load
raise UnsupportedModelError
spandrel.__helpers.registry.UnsupportedModelError
100% 20/20 [00:10<00:00, 1.97it/s]
Model '/content/gdrive/MyDrive/sd/stable-diffusion-webui/models/ESRGAN/ESRGAN_4x.pth' is not a 'ESRGAN' model (got <spandrel.architectures.ESRGAN.ESRGANArch object at 0x7a151176b850>)
tiled upscale100% 20/20 [00:07<00:00, 2.57it/s]
100% 10/10 [00:47<00:00, 4.74s/it]
Unable to load face-restoration model
Traceback (most recent call last):
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/face_restoration_utils.py", line 150, in restore_with_helper
self.net = self.load_net()
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/codeformer_model.py", line 37, in load_net
return modelloader.load_spandrel_model(
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/modelloader.py", line 150, in load_spandrel_model
model_descriptor = spandrel.ModelLoader(device=device).load_from_file(str(path))
File "/usr/local/lib/python3.10/dist-packages/spandrel/__helpers/loader.py", line 44, in load_from_file
return self.load_from_state_dict(state_dict)
File "/usr/local/lib/python3.10/dist-packages/spandrel/__helpers/loader.py", line 81, in load_from_state_dict
return self.registry.load(state_dict).to(self.device)
File "/usr/local/lib/python3.10/dist-packages/spandrel/__helpers/registry.py", line 184, in load
raise UnsupportedModelError
spandrel.__helpers.registry.UnsupportedModelError
Additional information
No response
I have also encountered this issue, and it seems that the latest 0.3.0 version of spandrel is not currently supported by the sd webui. In spandrel v0.3.0, some architectures with restrictive licenses are moved to the spandrel_extra_arches package. You could install spandrel v0.2.2 to fix it:
pip install spandrel==0.2.2
Or if you want to use the latest version of spandrel, first you should follow this:
pip install --upgrade spandrel_extra_arches spandrel
Then, you should add some lines to stable-diffusion-webui\modules\modelloader.py after line 149 (in load_spandrel_model function):
from spandrel import MAIN_REGISTRY
from spandrel_extra_arches import EXTRA_REGISTRY
# add extra architectures before `ModelLoader` is used
MAIN_REGISTRY.add(*EXTRA_REGISTRY)