mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-09 15:57:24 +08:00
fix(assets): normalize file_path separators to forward slashes on Windows
get_asset_category_and_relative_path returned os.path.relpath output directly, which uses backslashes on Windows, producing logical paths like 'LLM\model.safetensors'. Normalize to '/' so the logical file_path is platform-independent, matching _compute_relative. Fixes test_path_utils failures on windows-2022.
This commit is contained in:
parent
dbe4b19563
commit
0e6d281157
@ -211,7 +211,10 @@ def get_asset_category_and_relative_path(
|
||||
return root, rel
|
||||
|
||||
combined = os.path.join(folder_name, rel)
|
||||
return root, os.path.relpath(os.path.join(os.sep, combined), os.sep)
|
||||
normalized = os.path.relpath(os.path.join(os.sep, combined), os.sep)
|
||||
# Normalize to forward slashes so the logical path is identical across
|
||||
# platforms (os.path.relpath emits backslashes on Windows).
|
||||
return root, normalized.replace(os.sep, "/")
|
||||
|
||||
|
||||
def get_name_and_tags_from_asset_path(file_path: str) -> tuple[str, list[str]]:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user