Open olivierlacan opened 1 year ago
This error appears to be an issue with loading the model. Did you add --disable-safe-unpickle during startup. Please also make sure that the model files in the 'stable-diffusion-webui/models/deoldify' directory are complete. If they are incomplete, you can download them from Hugging Face according to the readme. The installation of fastai is actually for including its related dependencies. You will find a modified version of fastai in the plugin directory, which is actually the one being used. In fact, this is the true version of fastai being utilized.
I did just add --disable-safe-unpickle
but it doesn't seem to have solved it.
stable-diffusion-webui/models/deoldify
didn't exist actually so that might be the bigger issue, I'll try to reinstall or grab the models from HF.
It seems like fastai didn't have much to do with this, thanks for your help.
Reinstalling leads to a similar crash with install.py relating to fastai. Full stacktrace below.
As you can see --disable-safe-unpickle
does get passed but only after install.py seems to run, so I'm not sure how it could help?
It seems to be an issue with installing pynvx. You can try installing it separately by using the command: pip3 install pynvx --verbose.
You might want to loosen this version dependency because AFAIK older fastai versions rely on older pytorch versions that did not support ARM/M1 chips at all, so fastai tries to install with CUDA support enabled which obviously cannot work for ARM machines.
I fixed the issue on my machine by changing
for dep in ['wandb','fastai=1.0.60',
tofor dep in ['wandb','fastai>=1.0.60',
inWhile that allows deoldify to install, running it fails since it appears not to be compatible with fastai 2.x+:
*** Traceback (most recent call last): File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/safe.py", line 137, in load_with_extra check_pt(filename, extra_handler) File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/safe.py", line 95, in check_pt unpickler.load() File "/Users/olivierlacan/.pyenv/versions/3.10.12/lib/python3.10/pickle.py", line 1213, in load dispatch[key[0]](self) File "/Users/olivierlacan/.pyenv/versions/3.10.12/lib/python3.10/pickle.py", line 1529, in load_global klass = self.find_class(module, name) File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/safe.py", line 64, in find_class raise Exception(f"global '{module}/{name}' is forbidden") Exception: global 'functools/partial' is forbidden --- *** Error completing request *** Arguments: (0, <PIL.Image.Image image mode=RGB size=1049x1457 at 0x41BBB4E50>, None, '', '', True, 0, 4, 512, 512, True, 'None', 'None', 0, 0, 0, 0, True, 35, False) {} Traceback (most recent call last): File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/call_queue.py", line 58, in f res = list(func(*args, **kwargs)) File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/call_queue.py", line 37, in f res = func(*args, **kwargs) File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/postprocessing.py", line 62, in run_postprocessing scripts.scripts_postproc.run(pp, args) File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/scripts_postprocessing.py", line 130, in run script.process(pp, **process_args) File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/scripts/postprocessing_deoldify.py", line 44, in process pp.image = self.process_image(pp.image, render_factor, artistic) File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/scripts/postprocessing_deoldify.py", line 36, in process_image vis = get_image_colorizer(root_folder=Path(paths_internal.models_path),render_factor=render_factor, artistic=artistic) File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/visualize.py", line 417, in get_image_colorizer return get_stable_image_colorizer(root_folder=root_folder, render_factor=render_factor) File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/visualize.py", line 426, in get_stable_image_colorizer learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name) File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/generators.py", line 19, in gen_inference_wide learn.load(weights_name) File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/fastai/basic_train.py", line 267, in load if purge: self.purge(clear_opt=ifnone(with_opt, False)) File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/fastai/basic_train.py", line 325, in purge for a in attrs_pkl: setattr(self, a, state[a]) TypeError: 'NoneType' object is not subscriptable
Thank you very much @olivierlacan
hello @olivierlacan your change worked for me as well. i was not able to build pynvx before, now i see deoldify. thanks a lot.
You might want to loosen this version dependency because AFAIK older fastai versions rely on older pytorch versions that did not support ARM/M1 chips at all, so fastai tries to install with CUDA support enabled which obviously cannot work for ARM machines.
I fixed the issue on my machine by changing
for dep in ['wandb','fastai=1.0.60',
tofor dep in ['wandb','fastai>=1.0.60',
in https://github.com/SpenserCai/sd-webui-deoldify/blob/3cd19062dc22a18f215bf4716db1258f22e3bbc4/install.py#L46-L46While that allows deoldify to install, running it fails since it appears not to be compatible with fastai 2.x+: