mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-11 23:00:51 +08:00
Further modifications to paths
This commit is contained in:
parent
39c6335331
commit
b00964ace4
@ -754,6 +754,8 @@ def validate_inputs(prompt, item, validated: typing.Dict[str, ValidateInputsTupl
|
|||||||
if "\\" in val:
|
if "\\" in val:
|
||||||
# try to normalize paths for comparison purposes
|
# try to normalize paths for comparison purposes
|
||||||
val = canonicalize_path(val)
|
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:
|
if val not in type_input:
|
||||||
input_config = info
|
input_config = info
|
||||||
list_info = ""
|
list_info = ""
|
||||||
|
|||||||
@ -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:
|
def canonicalize_path(path: os.PathLike | str | None) -> str | None:
|
||||||
if path is None:
|
if path is None:
|
||||||
return None
|
return None
|
||||||
return PurePath(path).as_posix()
|
return PurePath(str(path).replace("\\", "/")).as_posix()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user