WASasquatch / was-node-suite-comfyui

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

CLIPSEG masking cannot handle video batch #315

Closed YacratesWyh closed 8 months ago

YacratesWyh commented 9 months ago
image

ERROR:root:Traceback (most recent call last): File "/home/admin188/anaconda3/envs/fooocus/lib/python3.10/site-packages/PIL/Image.py", line 3089, in fromarray mode, rawmode = _fromarray_typemap[typekey] KeyError: ((1, 1, 576, 3), '|u1')

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/admin188/AI/webui/ComfyUI/execution.py", line 153, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/home/admin188/AI/webui/ComfyUI/execution.py", line 83, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "/home/admin188/AI/webui/ComfyUI/execution.py", line 76, in map_node_over_list results.append(getattr(obj, func)(*slice_dict(input_data_all, i))) File "/home/admin188/AI/webui/ComfyUI/custom_nodes/was-node-suite-comfyui/WAS_Node_Suite.py", line 11007, in CLIPSeg_image image = tensor2pil(image) File "/home/admin188/AI/webui/ComfyUI/custom_nodes/was-node-suite-comfyui/WAS_Node_Suite.py", line 354, in tensor2pil return Image.fromarray(np.clip(255. image.cpu().numpy().squeeze(), 0, 255).astype(np.uint8)) File "/home/admin188/anaconda3/envs/fooocus/lib/python3.10/site-packages/PIL/Image.py", line 3092, in fromarray raise TypeError(msg) from e TypeError: Cannot handle this data type: (1, 1, 576, 3), |u1

WASasquatch commented 9 months ago

Yes it works for single images. Best bet is to use some custom node that converts a image batch into a image list, and make the node run for each image in list, then convert back to a batch. It will be some time before I update these. Though a PR is welcome.

YacratesWyh commented 8 months ago

Ah, KJNodes for ComfyUI has a batch there. Thx for reply.