From 2de762aac8e9fc4fb4b92165d7fefed595a4afaf Mon Sep 17 00:00:00 2001 From: aidec Date: Fri, 3 Oct 2025 19:13:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0path=5Fonly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/textbatch/nodes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/textbatch/nodes.py b/modules/textbatch/nodes.py index 8fa37f3..5081c89 100644 --- a/modules/textbatch/nodes.py +++ b/modules/textbatch/nodes.py @@ -749,8 +749,8 @@ class LoadImagesFromDirBatchM: } } - RETURN_TYPES = ("IMAGE", "MASK", "INT", "STRING", "STRING") - RETURN_NAMES = ("image", "mask", "count", "filenames", "full_paths") + RETURN_TYPES = ("IMAGE", "MASK", "INT", "STRING", "STRING", "STRING") + RETURN_NAMES = ("image", "mask", "count", "filenames", "full_paths", "path_only") FUNCTION = "load_images" CATEGORY = "image" @@ -783,7 +783,7 @@ class LoadImagesFromDirBatchM: masks = [] filenames = [] # 檔名列表(不含路徑) full_paths = [] # 完整路徑列表 - + path_only = directory # =輸入路徑 limit_images = False if image_load_cap > 0: limit_images = True @@ -818,7 +818,7 @@ class LoadImagesFromDirBatchM: if len(images) == 1: # 單張圖片時返回單一檔名和路徑 - return (images[0], masks[0], 1, filenames[0], full_paths[0]) + return (images[0], masks[0], 1, filenames[0], full_paths[0], path_only) elif len(images) > 1: image1 = images[0] @@ -845,7 +845,7 @@ class LoadImagesFromDirBatchM: mask1 = torch.cat((mask1, mask2), dim=0) # 多張圖片時返回以逗號分隔的檔名和路徑字串 - return (image1, mask1, len(images), ",".join(filenames), ",".join(full_paths)) + return (image1, mask1, len(images), ",".join(filenames), ",".join(full_paths), path_only) class ImageFilenameProcessor: """圖片檔名處理節點