YanWenKun / ComfyUI-Windows-Portable

🎨ComfyUI standalone pack with 30+ custom nodes. | ComfyUI 大号整合包,预装大量自定义节点(不含SD模型)
GNU General Public License v3.0
160 stars 20 forks source link

[Version 2024/11/07]ComfyUI-3D-Pack\_Example_Workflows\CRM\CRM_Img_to_Multi-views_to_CCMs_to_Mesh.json error #37

Open coddz opened 6 days ago

coddz commented 6 days ago

PC: 4090 14900kf

Detailed Error Message:

!!! Exception during processing !!! The shape of the 2D attn_mask is torch.Size([77, 77]), but should be (1, 1).
Traceback (most recent call last):
  File "D:\ComfyUI_Windows_portable\ComfyUI\execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\ComfyUI\execution.py", line 198, in get_output_data
    return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "D:\ComfyUI_Windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 2121, in load_CRM
    crm_mvdiffusion_sampler = get_obj_from_str(crm_config.sampler.target)(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\CRM\libs\sample.py", line 32, in __init__
    uc = model.get_learned_conditioning([neg_texts]).to(device)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\CRM\imagedream\ldm\interface.py", line 185, in get_learned_conditioning
    return self.clip_model(prompts)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\CRM\imagedream\ldm\modules\encoders\modules.py", line 218, in forward
    z = self.encode_with_transformer(tokens.to(self.device))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\CRM\imagedream\ldm\modules\encoders\modules.py", line 282, in encode_with_transformer
    x = self.text_transformer_forward(x, attn_mask=self.model.attn_mask)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\CRM\imagedream\ldm\modules\encoders\modules.py", line 297, in text_transformer_forward
    x = r(x, attn_mask=attn_mask)
        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\open_clip\transformer.py", line 263, in forward
    x = q_x + self.ls_1(self.attention(q_x=self.ln_1(q_x), k_x=k_x, v_x=v_x, attn_mask=attn_mask))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\open_clip\transformer.py", line 250, in attention
    return self.attn(
           ^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\activation.py", line 1368, in forward
    attn_output, attn_output_weights = F.multi_head_attention_forward(
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\torch\nn\functional.py", line 6131, in multi_head_attention_forward
    raise RuntimeError(
RuntimeError: The shape of the 2D attn_mask is torch.Size([77, 77]), but should be (1, 1).
coddz commented 6 days ago

"ComfyUI-3D-Pack_Example_Workflows\CRM\CRM_Img_to_Multi-views_to_CCMs_to_Mesh.json" on another comfyui with the newest MrForExample/ComfyUI-3D-Pack raise the same error .

I once suspected that the whl files and various software packages I installed might have been faulty, so I tried your portable package.

I still very much appreciate your work; there's so much related to ComfyUI-3D-Pack, and you've helped simplify a lot of it.

YanWenKun commented 6 days ago

新版 open-clip-torch 导致旧的工作流失效,上游是不太可能做更新了,最简单的办法是用旧版整合包,比如 2024/05/21 版本。

For anyone got the same error RuntimeError: The shape of the 2D attn_mask is torch.Size([77, 77]), but should be (1, 1).:

Just use older release of this package, such as 2024/05/21.

coddz commented 6 days ago

哦,原来如此。多谢,多谢!我再试试2024/05/21版本

coddz commented 6 days ago

退回到[2024/05/21]版本,CRM就可以正确执行了,关键就是open-clip-torch<=2.24