WASasquatch / was-node-suite-comfyui

An extensive node suite for ComfyUI with over 210 new nodes
MIT License
1.18k stars 177 forks source link

Error occurred when executing Mask Crop Minority Region #223

Open Alien6666 opened 1 year ago

Alien6666 commented 1 year ago

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))

WASasquatch commented 1 year ago

By no mask you mean just a blank black image?

Alien6666 commented 1 year ago

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.

WASasquatch commented 1 year ago

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

Alien6666 commented 1 year ago

workflow_example.zip