From b7e011f5e72a4f5a84eccf5564fee8afeb05de2f Mon Sep 17 00:00:00 2001 From: David Strouk Date: Sun, 4 May 2025 16:59:04 +0300 Subject: [PATCH 1/4] Fix model download path and URL - Use models_dir instead of abs_dir for download path - Create models directory if it doesn't exist - Fix Hugging Face download URL by using /resolve/ instead of /blob/ --- modules/processors/frame/face_swapper.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/processors/frame/face_swapper.py b/modules/processors/frame/face_swapper.py index 36b83d6..531faa7 100644 --- a/modules/processors/frame/face_swapper.py +++ b/modules/processors/frame/face_swapper.py @@ -28,11 +28,17 @@ models_dir = os.path.join( def pre_check() -> bool: - download_directory_path = abs_dir + # Use models_dir instead of abs_dir to save to the correct location + download_directory_path = models_dir + + # Make sure the models directory exists + os.makedirs(download_directory_path, exist_ok=True) + + # Use the direct download URL from Hugging Face conditional_download( download_directory_path, [ - "https://huggingface.co/hacksider/deep-live-cam/blob/main/inswapper_128_fp16.onnx" + "https://huggingface.co/hacksider/deep-live-cam/resolve/main/inswapper_128_fp16.onnx" ], ) return True From ae88412aaecf7fc2bc6482ac9d3e8c923d26bd62 Mon Sep 17 00:00:00 2001 From: David Strouk Date: Sun, 4 May 2025 17:04:08 +0300 Subject: [PATCH 2/4] Update modules/processors/frame/face_swapper.py Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- modules/processors/frame/face_swapper.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/processors/frame/face_swapper.py b/modules/processors/frame/face_swapper.py index 531faa7..59e3a59 100644 --- a/modules/processors/frame/face_swapper.py +++ b/modules/processors/frame/face_swapper.py @@ -31,8 +31,12 @@ def pre_check() -> bool: # Use models_dir instead of abs_dir to save to the correct location download_directory_path = models_dir - # Make sure the models directory exists - os.makedirs(download_directory_path, exist_ok=True) + # Make sure the models directory exists, catch permission errors if they occur + try: + os.makedirs(download_directory_path, exist_ok=True) + except PermissionError as e: + logging.error(f"Failed to create directory {download_directory_path} due to permission error: {e}") + return False # Use the direct download URL from Hugging Face conditional_download( From 647c5f250f8489592b73b63b495facfebc0e03df Mon Sep 17 00:00:00 2001 From: David Strouk Date: Sun, 4 May 2025 17:06:09 +0300 Subject: [PATCH 3/4] Update modules/processors/frame/face_swapper.py Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- modules/processors/frame/face_swapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/processors/frame/face_swapper.py b/modules/processors/frame/face_swapper.py index 59e3a59..7318cce 100644 --- a/modules/processors/frame/face_swapper.py +++ b/modules/processors/frame/face_swapper.py @@ -34,7 +34,7 @@ def pre_check() -> bool: # Make sure the models directory exists, catch permission errors if they occur try: os.makedirs(download_directory_path, exist_ok=True) - except PermissionError as e: + except OSError as e: logging.error(f"Failed to create directory {download_directory_path} due to permission error: {e}") return False From 677a4dd09632e2fac88d0ba17884731dbd2a7383 Mon Sep 17 00:00:00 2001 From: padawan40 <115617728+padawan40@users.noreply.github.com> Date: Tue, 13 May 2025 21:16:10 +0200 Subject: [PATCH 4/4] Create .DS_Store --- .DS_Store | Bin 0 -> 6148 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e9ab126ecd95aaf244b7b553a71a3fdd25fda049 GIT binary patch literal 6148 zcmeHKOHRWu6dXf=@)KRMLCOV)#0^3}LY1IM6!!EdR4HxvG>Go9=MG$f^Ra??wuO?k zumptOlb*+QX6$%W+c5xBPlrc94M3GCSlME+B;>i|Lag|fU81plT%e6Qu5d}zPzTh3 zzwUsn-90pLjt*CCe*JcEf)Eo7+i^1J$4Q?|*(Q#e;kymifDN2-wKvdW4_&lM?AHZ$ zj06Mp5MzXgBHJ94*lQergdxW0m6*>Z<~o@PnIraF?)B|E?qm0U8Yj~ma=3?aHm;v^ z+54>sD?j%t*>l|T{X*sxLqZPMWuTbno|E^}A>$}4KP=bY}4vVWg*jD5y-e=n2 Yvp_1u$YbV^Ee!n-ur_F+4*aMC9|zR7NdN!< literal 0 HcmV?d00001