From f4e65590b8a09e4b39eb697d7ebbd1dd2c2b0e97 Mon Sep 17 00:00:00 2001 From: doctorpangloss <@hiddenswitch.com> Date: Fri, 14 Feb 2025 07:20:58 -0800 Subject: [PATCH] Fix subfolder being None when images are viewed --- comfy/component_model/file_output_path.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comfy/component_model/file_output_path.py b/comfy/component_model/file_output_path.py index 6ea1b8e12..20b5d9fff 100644 --- a/comfy/component_model/file_output_path.py +++ b/comfy/component_model/file_output_path.py @@ -23,8 +23,9 @@ def file_output_path(filename: str, type: Literal["input", "output", "temp"] = " raise ValueError(f"no such output directory because invalid type specified (type={type})") output_dir = Path(output_dir) # seems to misbehave + subfolder = subfolder or "" subfolder = subfolder.replace("\\", "/") - subfolder = Path(subfolder or "") + subfolder = Path(subfolder) try: relative_to = (output_dir / subfolder / filename).relative_to(output_dir) except ValueError: