This commit is contained in:
dzqdzq 2025-04-11 09:46:27 -04:00 committed by GitHub
commit 3a10f04b7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1655,14 +1655,17 @@ class LoadImage:
input_dir = folder_paths.get_input_directory()
files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))]
return {"required":
{"image": (sorted(files), {"image_upload": True})},
{
"image": (sorted(files), {"image_upload": True}),
"out_alpha": ("BOOLEAN", {"default": False}),
}
}
CATEGORY = "image"
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)
@ -1678,7 +1681,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]