From 68e5dad89312c04024c03d07a0c3b8bd0358f089 Mon Sep 17 00:00:00 2001 From: wl-zhao Date: Sun, 20 Oct 2024 11:23:02 +0800 Subject: [PATCH] update file path --- dependency_checker.py | 4 ++-- utils.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dependency_checker.py b/dependency_checker.py index b22c1eb..b9fee0b 100644 --- a/dependency_checker.py +++ b/dependency_checker.py @@ -46,7 +46,7 @@ def handle_model_info(ckpt_path): item = { "filename": filename, - "save_path": save_path, + "save_path": windows_to_linux_path(save_path), "urls": urls, } return model_id, item @@ -192,7 +192,7 @@ def resolve_dependencies(prompt, custom_dependencies): # resolve custom nodes an # step 3: handle local files process_local_file_path_async(file_mapping_dict, max_workers=20) - files_dict = {v[0]: {"filename": os.path.relpath(v[2], BASE_PATH), "urls": [v[1]]} for v in file_mapping_dict.values()} + files_dict = {v[0]: {"filename": windows_to_linux_path(os.path.relpath(v[2], BASE_PATH)), "urls": [v[1]]} for v in file_mapping_dict.values()} results = { "comfyui_version": comfyui_version, diff --git a/utils.py b/utils.py index 3df3c03..4854509 100644 --- a/utils.py +++ b/utils.py @@ -1,9 +1,9 @@ import hashlib import time -from pathlib import PurePosixPath, Path +from pathlib import PurePosixPath, Path, PureWindowsPath def windows_to_linux_path(windows_path): - return str(PurePosixPath(Path(windows_path))) + return PureWindowsPath(windows_path).as_posix() def compute_sha256(file_path, chunk_size=1024 ** 2): # Create a new sha256 hash object