This commit is contained in:
浪浪辛 2026-01-22 06:01:55 +02:00 committed by GitHub
commit ae9798405a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1667,7 +1667,10 @@ class LoadImage:
files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))]
files = folder_paths.filter_files_content_types(files, ["image"])
return {"required":
{"image": (sorted(files), {"image_upload": True})},
{
"image": (sorted(files), {"image_upload": True}),
"out_alpha": ("BOOLEAN", {"default": False}),
}
}
CATEGORY = "image"
@ -1675,7 +1678,7 @@ class LoadImage:
RETURN_TYPES = ("IMAGE", "MASK")
FUNCTION = "load_image"
def load_image(self, image):
def load_image(self, image, out_alpha):
image_path = folder_paths.get_annotated_filepath(image)
img = node_helpers.pillow(Image.open, image_path)
@ -1689,7 +1692,7 @@ class LoadImage:
if i.mode == 'I':
i = i.point(lambda i: i * (1 / 255))
image = i.convert("RGB")
image = i.convert("RGBA" if out_alpha else "RGB")
if len(output_images) == 0:
w = image.size[0]