Skip to content

Commit 82f3a05

Browse files
committed
fix mask bug
1 parent 07c0807 commit 82f3a05

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

comfy-nodes/input_image.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ def VALIDATE_INPUTS(s, input_name, default_value, description=""):
5959
if image.startswith("http"):
6060
return True
6161

62-
if not os.path.isfile(image):
62+
if image == "":
6363
return "Invalid image file: please check if the image is empty or invalid"
6464

65-
if folder_paths.exists_annotated_filepath(image):
65+
if not folder_paths.exists_annotated_filepath(image):
6666
return "Invalid image file: {}".format(image)
6767

6868
return True
@@ -107,6 +107,7 @@ def convert_image_mask(self, img):
107107

108108
return (output_image, output_mask)
109109

110+
110111
def run(self, input_name, default_value=None, display_name=None, description=None):
111112
input_dir = folder_paths.get_input_directory()
112113
image_path = default_value
@@ -128,7 +129,7 @@ def run(self, input_name, default_value=None, display_name=None, description=Non
128129
if not os.path.isfile(image_path): # abs path
129130
# local path
130131
image_path = os.path.join(input_dir, image_path)
131-
image = Image.open(image_path).convert("RGB")
132+
image = node_helpers.pillow(Image.open, image_path)
132133

133134
return self.convert_image_mask(image)
134135
# image = ImageOps.exif_transpose(image)

0 commit comments

Comments
 (0)