From b00964ace4ec53bba70d7eb36d0aa2f8d5d7b3ff Mon Sep 17 00:00:00 2001 From: doctorpangloss <@hiddenswitch.com> Date: Mon, 5 Aug 2024 17:06:18 -0700 Subject: [PATCH] Further modifications to paths --- comfy/cmd/execution.py | 2 ++ comfy/component_model/files.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/comfy/cmd/execution.py b/comfy/cmd/execution.py index 9ea2c6b8d..0930ebc21 100644 --- a/comfy/cmd/execution.py +++ b/comfy/cmd/execution.py @@ -754,6 +754,8 @@ def validate_inputs(prompt, item, validated: typing.Dict[str, ValidateInputsTupl if "\\" in val: # try to normalize paths for comparison purposes val = canonicalize_path(val) + if all(isinstance(item, (str, PathLike)) for item in type_input): + type_input = [canonicalize_path(item) for item in type_input] if val not in type_input: input_config = info list_info = "" diff --git a/comfy/component_model/files.py b/comfy/component_model/files.py index c35a88af1..fe4f9c010 100644 --- a/comfy/component_model/files.py +++ b/comfy/component_model/files.py @@ -58,4 +58,4 @@ def get_package_as_path(package: str, subdir: Optional[str] = None) -> str: def canonicalize_path(path: os.PathLike | str | None) -> str | None: if path is None: return None - return PurePath(path).as_posix() + return PurePath(str(path).replace("\\", "/")).as_posix()