Both GPFGAN and CodeFormer throw PermissionError: [Errno 13]
Right now this is the problem I’ve been banging my head against all day. Every time I try to use GPFGAN and CodeFormer, I get the following errors that I do not understand. I suppose I will discontinue my attempts and wait to see if anyone knows more, because I’m stuck. If I’m still stuck tomorrow, I will probably rip everything out and start over.I do havesomeexperience at the Linux command line but I’ll be honest – I used to like diving into the guts of the OS, but not in the last decade or so. As a consequence, I find solving problems that manifest in a “Linuxy way” (as opposed to a “Windows way”) to be an order of magnitude more difficult than you all seem to think it is. Please bear that in mind.I’m running Windows 11. System is an i5-8500 (6 cores like an i7-8700 but no Hyperthreading), 16 GB of RAM, and an RTX 3060 (12 GB VRAM).I have to admit Iabsolutely hatedependency chain hell and I’m about to just abandon local Stable Diffusion altogether because I just can’t get it to work right. Something seems to be broken at every turn, and I spend hours searching for similar problems only to not find any or to  see them “closed as stale” without resolution (my particular pet peeve!). This is just way too fiddly and fragile, it seems like one continuous game of whack-a-mole.*** Error completing request*** Arguments: (‘task(z8a3uvu6wxtboqx)’, 0.0, <PIL.Image.Image image mode=RGBA size=512x512 at 0x2BFB69F0A00>, None, ‘’, ‘’, True, False, 0.0, 4, 0.0, 512, 512, True, ‘None’, ‘None’, 0, True, 1, False, 1, 0, False, 0.5, 0.2, False, 0.9, 0.15, 0.5, False, False, 384, 768, 4096, 409600, ‘Maximize area’, 0.1, False, [‘Horizontal’], False, [‘Deepbooru’]) {}Traceback (most recent call last):File “C:\Other Programs\Stable Diffusion\webui\modules\call_queue.py”, line 57, in fres = list(func(*args, **kwargs))File “C:\Other Programs\Stable Diffusion\webui\modules\call_queue.py”, line 36, in fres = func(*args, **kwargs)File “C:\Other Programs\Stable Diffusion\webui\modules\postprocessing.py”, line 131, in run_postprocessing_webuireturn run_postprocessing(*args, **kwargs)File “C:\Other Programs\Stable Diffusion\webui\modules\postprocessing.py”, line 71, in run_postprocessingscripts.scripts_postproc.run(initial_pp, args)File “C:\Other Programs\Stable Diffusion\webui\modules\scripts_postprocessing.py”, line 198, in runscript.process(single_image, **process_args)File “C:\Other Programs\Stable Diffusion\webui\scripts\postprocessing_gfpgan.py”, line 25, in processrestored_img = gfpgan_model.gfpgan_fix_faces(np.array(pp.image.convert(“RGB”), dtype=np.uint8))File “C:\Other Programs\Stable Diffusion\webui\modules\gfpgan_model.py”, line 58, in gfpgan_fix_facesreturn gfpgan_face_restorer.restore(np_image)File “C:\Other Programs\Stable Diffusion\webui\modules\gfpgan_model.py”, line 53, in restorereturn self.restore_with_helper(np_image, restore_face)File “C:\Other Programs\Stable Diffusion\webui\modules\face_restoration_utils.py”, line 156, in restore_with_helperself.send_model_to(self.get_device())File “C:\Other Programs\Stable Diffusion\webui\modules\face_restoration_utils.py”, line 132, in send_model_toif self.face_helper:File “C:\Users\ADMIND\AppData\Local\Programs\Python\Python310\lib\functools.py”, line 981, ingetval = self.func(instance)File “C:\Other Programs\Stable Diffusion\webui\modules\face_restoration_utils.py”, line 126, in face_helperreturn create_face_helper(self.get_device())File “C:\Other Programs\Stable Diffusion\webui\modules\face_restoration_utils.py”, line 47, in create_face_helperreturn FaceRestoreHelper(File “C:\Other Programs\Stable Diffusion\webui\venv\lib\site-packages\facexlib\utils\face_restoration_helper.py”, line 99, ininitself.face_det = init_detection_model(det_model, half=False, device=self.device, model_rootpath=model_rootpath)File “C:\Other Programs\Stable Diffusion\webui\venv\lib\site-packages\facexlib\detection_init_.py”, line 18, in init_detection_modelmodel_path = load_file_from_url(File “C:\Other Programs\Stable Diffusion\webui\modules\face_restoration_utils.py”, line 174, in facex_load_file_from_urlreturn det_facex_load_file_from_url(**update_kwargs(kwargs))File “C:\Other Programs\Stable Diffusion\webui\venv\lib\site-packages\facexlib\utils\misc.py”, line 77, in load_file_from_urldownload_url_to_file(url, cached_file, hash_prefix=None, progress=progress)File “C:\Other Programs\Stable Diffusion\webui\venv\lib\site-packages\torch\hub.py”, line 638, in download_url_to_filef = open(tmp_dst, ‘w+b’)PermissionError: [Errno 13] Permission denied: ‘C:\Other Programs\Stable Diffusion\webui\models\GFPGAN\detection_Resnet50_Final.pth.9342ed0cbe7547f78c282d6a51909d50.partial’
2024-07-10T00:39:36Z
Here’s the advice I got from Llama 3 Instruct. I still don’t understand it well enough to know if it will fix anything, or even how to do some of it, but is it at least on the right track?Llama 3 Instruct:It looks like the issue is related to permission denied errors when trying to download files from URLs usingtorch.hub.download_url_to_file. This suggests that there might be an issue with file permissions or access rights.Here are some potential causes and suggestions:File system permissions: Make sure you have write permissions for the directory where Stable Diffusion is installed (e.g.,C:\Other Programs\Stable Diffusion). You can try running your script as administrator to see if that resolves the issue.Temporary file creation: The error message mentions a temporary file (tmp_ dst) being created during the download process. This might be related to permissions issues with creating files in certain directories.Model loading: It seems like there’s an issue with loading models (e.g.,detection_Resnet50_Final.pth), which is causing the permission denied error.To troubleshoot this further, you can try:Check your file system permissions and ensure that you have write access to the relevant directories.Try running your script in a different directory or with elevated privileges (e.g., as administrator).Investigate why model loading is failing by checking if there are any issues with the models themselves, such as corrupted files or incorrect paths.If none of these suggestions help, please provide more context about your environment and setup, including:Your operating systemPython versionStable Diffusion installation method (e.g., pip, conda)Any relevant configuration files or settingsI’ll do my best to assist you in resolving this issue!Prompt:that .partial file doeesn’t ever seem to exist when I go to look.Response:The.partialfile not existing could be a clue!In that case, it’s possible that the error is related to the model loading process rather than permissions issues.Here are some potential causes and suggestions:Model corruption: Thedetection_Resnet50_Final.pthmodel might be corrupted or incomplete, which would prevent it from being loaded correctly.Incorrect model path: Double-check if the model file exists at the expected location (C:\Other Programs\Stable Diffusion\webui\models\GFPGAN). If not, ensure that you have downloaded the correct model and placed it in the right directory.To troubleshoot this further:Check the integrity of thedetection_Resnet50_Final.pthfile by downloading it again or verifying its contents.Verify if there are any typos or incorrect paths when loading the model. Make sure you’re using the correct path and filename.If you’ve modified your code to load models from a different location, ensure that the new path is correct.If none of these suggestions help, please provide more context about how you installed Stable Diffusion and any relevant configuration files or settings.
2024-07-13T11:22:17Z
This seems to have been corrected by using Stability Matrix to handle all packages and the like, instead of the haphazard manual method.