ZHO-ZHO-ZHO / ComfyUI-YoloWorld-EfficientSAM

Unofficial implementation of YOLO-World + EfficientSAM for ComfyUI
GNU General Public License v3.0
625 stars 58 forks source link

我无法实现案例中的“蒙版分离”效果 #55

Closed Un1ess closed 6 months ago

Un1ess commented 6 months ago

期望效果(案例) image_45

我的节点设置: image

运行后的报错信息: image

报错信息具体: ERROR:root:!!! Exception during processing !!! ERROR:root:Traceback (most recent call last): File "D:\ComfyUI_Build\python_embeded\Lib\site-packages\PIL\Image.py", line 3098, in fromarray mode, rawmode = _fromarray_typemap[typekey]


KeyError: ((1, 1, 12), '|u1')

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

Traceback (most recent call last):
  File "D:\ComfyUI_Build\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Build\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 "D:\ComfyUI_Build\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Build\ComfyUI\nodes.py", line 1439, in save_images
    img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Build\python_embeded\Lib\site-packages\PIL\Image.py", line 3102, in fromarray
    raise TypeError(msg) from e
TypeError: Cannot handle this data type: (1, 1, 12), |u1
Un1ess commented 6 months ago

image 问题解决了,要先使用Mask List to Mask节点,然后再使用Convert Masks to Images