Skip to content

Commit

Permalink
Update WAS_Image_Threshold to accept batch images
Browse files Browse the repository at this point in the history
  • Loading branch information
WAS-PlaiLabs committed Sep 8, 2024
1 parent ee2e31a commit 2a5be77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion WAS_Node_Suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -5596,7 +5596,10 @@ def INPUT_TYPES(cls):
CATEGORY = "WAS Suite/Image/Process"

def image_threshold(self, image, threshold=0.5):
return (pil2tensor(self.apply_threshold(tensor2pil(image), threshold)), )
images = []
for img in image:
images.append(pil2tensor(self.apply_threshold(tensor2pil(img), threshold)))
return (torch.cat(images, dim=0), )

def apply_threshold(self, input_image, threshold=0.5):
# Convert the input image to grayscale
Expand Down

0 comments on commit 2a5be77

Please sign in to comment.