REFINE 修正输出文件夹路径检查逻辑,确保保存图像时不在输出文件夹外

This commit is contained in:
iHeyTang 2025-08-12 19:40:05 +08:00
parent a3d113b8a8
commit 467c8b2549
1 changed files with 1 additions and 1 deletions

View File

@ -177,7 +177,7 @@ class SaveImageWithOutput:
subfolder = ""
full_output_folder = os.path.join(output_dir, subfolder)
if os.path.commonpath((output_dir, os.path.abspath(full_output_folder))) != output_dir:
if os.path.commonpath((os.path.abspath(output_dir), os.path.abspath(full_output_folder))) != os.path.abspath(output_dir):
print("Saving image outside the output folder is not allowed.")
return {}