was-node-suite-comfyui icon indicating copy to clipboard operation
was-node-suite-comfyui copied to clipboard

Error occurred when executing Mask Crop Minority Region

Open Alien6666 opened this issue 2 years ago • 4 comments

I think this error is happening when there are no masks.

Error occurred when executing Mask Crop Minority Region:

min() arg is an empty sequence

File "F:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "F:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "F:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "F:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui\WAS_Node_Suite.py", line 7485, in crop_minority_region region_mask = self.WT.Masking.crop_minority_region(mask_pil, padding) File "F:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui\WAS_Node_Suite.py", line 1437, in crop_minority_region smallest_label = min(range(1, num_labels + 1), key=lambda i: np.sum(labeled_image == i))

Alien6666 avatar Sep 29 '23 21:09 Alien6666

By no mask you mean just a blank black image?

WASasquatch avatar Sep 29 '23 22:09 WASasquatch

I'm using MediaPipe to detect the face and converting the SEGS to mask, if there's no face detected it causes the error when it gets to the mask crop node.

Alien6666 avatar Sep 30 '23 00:09 Alien6666

I'm using MediaPipe to detect the face and converting the SEGS to mask, if there's no face detected it causes the error when it gets to the mask crop node.

CLIPSeg node in WAS-NS or another seg node? Want to investigate what it's outputting in that case

WASasquatch avatar Sep 30 '23 01:09 WASasquatch