update file path

This commit is contained in:
wl-zhao
2024-10-20 11:23:02 +08:00
parent 9a606f550d
commit 68e5dad893
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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