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

Error occurred when executing BLIP Analyze Image: #289

Closed h3clikejava closed 10 months ago

h3clikejava commented 10 months ago

The size of tensor a (3) must match the size of tensor b (9) at non-singleton dimension 0

File "/home/h3c/Documents/ComfyUI/execution.py", line 153, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/home/h3c/Documents/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/h3c/Documents/ComfyUI/execution.py", line 76, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) File "/home/h3c/Documents/ComfyUI/custom_nodes/was-node-suite-comfyui/WAS_Node_Suite.py", line 10895, in blip_caption_image answer = model(tensor, question, train=False, inference='generate') File "/home/h3c/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, *kwargs) File "/home/h3c/Documents/ComfyUI/custom_nodes/was-node-suite-comfyui/modules/BLIP/blip_module.py", line 336, in forward outputs = self.text_decoder.generate(input_ids=bos_ids, File "/home/h3c/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(args, kwargs) File "/home/h3c/.local/lib/python3.10/site-packages/transformers/generation/utils.py", line 1752, in generate return self.beam_search( File "/home/h3c/.local/lib/python3.10/site-packages/transformers/generation/utils.py", line 3091, in beam_search outputs = self( File "/home/h3c/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, kwargs) File "/home/h3c/Documents/ComfyUI/custom_nodes/was-node-suite-comfyui/modules/BLIP/blip_med.py", line 886, in forward outputs = self.bert( File "/home/h3c/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, *kwargs) File "/home/h3c/Documents/ComfyUI/custom_nodes/was-node-suite-comfyui/modules/BLIP/blip_med.py", line 781, in forward encoder_outputs = self.encoder( File "/home/h3c/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, kwargs) File "/home/h3c/Documents/ComfyUI/custom_nodes/was-node-suite-comfyui/modules/BLIP/blip_med.py", line 445, in forward layer_outputs = layer_module( File "/home/h3c/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, kwargs) File "/home/h3c/Documents/ComfyUI/custom_nodes/was-node-suite-comfyui/modules/BLIP/blip_med.py", line 361, in forward cross_attention_outputs = self.crossattention( File "/home/h3c/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, *kwargs) File "/home/h3c/Documents/ComfyUI/custom_nodes/was-node-suite-comfyui/modules/BLIP/blip_med.py", line 277, in forward self_outputs = self.self( File "/home/h3c/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, kwargs) File "/home/h3c/Documents/ComfyUI/custom_nodes/was-node-suite-comfyui/modules/BLIP/blip_med.py", line 178, in forward attention_scores = torch.matmul(query_layer, key_layer.transpose(-1, -2))

image

ComfyUI Revision: 1759 [c97be4db] | Released on '2023-11-30'

Total VRAM 24214 MB, total RAM 48088 MB xformers version: 0.0.21 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 4090 : cudaMallocAsync VAE dtype: torch.bfloat16 Torch version: 2.0.1+cu117

TWIISTED-STUDIOS commented 9 months ago

how did you fix this?

WASasquatch commented 9 months ago

Probably installed the requirements.txt. the old blip is abandoned by transformers it seems and they haven't updated documentation. Other custom nodes using transformers often update to new versions.

On Mon, Dec 18, 2023, 6:40 PM TWIISTED-STUDIOS @.***> wrote:

how did you fix this?

— Reply to this email directly, view it on GitHub https://github.com/WASasquatch/was-node-suite-comfyui/issues/289#issuecomment-1862012388, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIZEZI43KPVLB55M73K2T3YKD5C7AVCNFSM6AAAAABACEWFS6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRSGAYTEMZYHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

orbithammer commented 8 months ago

If you, like me, were wondering how to install requirments.txt, there's a install.bat in custom_nodes\was-node-suite-comfyui.

CaptailTyler commented 6 months ago

If you, like me, were wondering how to install requirments.txt, there's a install.bat in custom_nodes\was-node-suite-comfyui.

This worked for me. Thanks!

bibhatsukuiri commented 5 months ago

If you, like me, were wondering how to install requirments.txt, there's a install.bat in custom_nodes\was-node-suite-comfyui.

this worked. thanks