Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest ComfyUI Update broke Supir Node Compatability #144

Closed
Vigilence opened this issue Jul 5, 2024 · 15 comments
Closed

Latest ComfyUI Update broke Supir Node Compatability #144

Vigilence opened this issue Jul 5, 2024 · 15 comments

Comments

@Vigilence
Copy link

I just updated comfui to the latest update and none of my supir node workflows work. Uninstalling, reinstalling etc does not work.

@kijai
Copy link
Owner

kijai commented Jul 5, 2024

I just tried with latest ComfyUI and I have no problems, what is the error you are getting?

@dicksondickson
Copy link

I'm getting this as well. Here is the log:

`Error occurred when executing SUPIR_conditioner:

The shape of the 2D attn_mask is torch.Size([77, 77]), but should be (1, 1).

File "C:\AI\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AI\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AI\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AI\ComfyUI\custom_nodes\ComfyUI-SUPIR\nodes_v2.py", line 637, in condition
_c, _uc = SUPIR_model.conditioner.get_unconditional_conditioning(cond, uncond)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AI\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\modules\encoders\modules.py", line 187, in get_unconditional_conditioning
c = self(batch_c)
^^^^^^^^^^^^^
File "C:\Users\dickson\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1714, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dickson\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1725, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AI\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\modules\encoders\modules.py", line 208, in forward
emb_out = embedder(batch[embedder.input_key])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dickson\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1714, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dickson\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1725, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AI\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\modules\encoders\modules.py", line 568, in forward
z = self.encode_with_transformer(tokens.to(self.device))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AI\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\modules\encoders\modules.py", line 580, in encode_with_transformer
x = self.text_transformer_forward(x, attn_mask=self.model.attn_mask)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AI\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\modules\encoders\modules.py", line 612, in text_transformer_forward
x = r(x, attn_mask=attn_mask)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dickson\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1714, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dickson\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1725, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dickson\AppData\Local\Programs\Python\Python311\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 "C:\Users\dickson\AppData\Local\Programs\Python\Python311\Lib\site-packages\open_clip\transformer.py", line 250, in attention
return self.attn(
^^^^^^^^^^
File "C:\Users\dickson\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1714, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dickson\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1725, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dickson\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\activation.py", line 1368, in forward
attn_output, attn_output_weights = F.multi_head_attention_forward(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dickson\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\functional.py", line 6100, in multi_head_attention_forward
raise RuntimeError(`

@dicksondickson
Copy link

@kijai
Copy link
Owner

kijai commented Jul 6, 2024

Okay I think I found it, some other custom node must have updated open-clip-torch as with it's latest version I'm getting same error. open-clip-torch==2.24.0 still works

@dicksondickson
Copy link

dicksondickson commented Jul 6, 2024

You are amazing. Thank you! I just installed open-clip-torch==2.24.0 like you said and its working again. The following is the nodes I have installed and it seems CCSR is the other node that have open-clip-torch in requirements.txt.

0.0 seconds: C:\AI\ComfyUI\custom_nodes\websocket_image_save.py
0.0 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI-Chibi-Nodes
0.0 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale
0.0 seconds: C:\AI\ComfyUI\custom_nodes\rgthree-comfy
0.0 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI-Dickson-Nodes
0.0 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI-KJNodes
0.0 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI_essentials
0.0 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI_Comfyroll_CustomNodes
0.0 seconds: C:\AI\ComfyUI\custom_nodes\comfyui-prompt-reader-node
0.1 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI-Custom-Scripts
0.1 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack
0.2 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI-Manager
0.4 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI-SUPIR
0.8 seconds: C:\AI\ComfyUI\custom_nodes\was-node-suite-comfyui
1.0 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI-CCSR
2.5 seconds: C:\AI\ComfyUI\custom_nodes\ComfyUI-Crystools

@kijai
Copy link
Owner

kijai commented Jul 6, 2024

I found what caused it in the open-clip-torch update, and added a work around. Should now work even with the latest version.

@sdk401
Copy link

sdk401 commented Jul 6, 2024

Not working for me, not even importing, tried reinstalling, open-clip-torch is 2.24.0

1.2 seconds (IMPORT FAILED): C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR

@kijai
Copy link
Owner

kijai commented Jul 6, 2024

Not working for me, not even importing, tried reinstalling, open-clip-torch is 2.24.0

1.2 seconds (IMPORT FAILED): C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR

Different error then, and that doesn't tell me anything, the real error is in the log somewhere.

@sdk401
Copy link

sdk401 commented Jul 6, 2024

Not working for me, not even importing, tried reinstalling, open-clip-torch is 2.24.0
1.2 seconds (IMPORT FAILED): C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR

Different error then, and that doesn't tell me anything, the real error is in the log somewhere.

here is the complete error, looks like something with flash-attn-cuda. worked fine yesterday

Traceback (most recent call last):
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\nodes.py", line 1907, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR_init
.py", line 1, in
from .nodes import SUPIR_Upscale
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR\nodes.py", line 11, in
from .sgm.util import instantiate_from_config
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm_init_.py", line 1, in
from .models import AutoencodingEngine, DiffusionEngine
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\models_init_.py", line 1, in
from .autoencoder import AutoencodingEngine
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\models\autoencoder.py", line 12, in
from ..modules.diffusionmodules.model import Decoder, Encoder
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\modules_init_.py", line 1, in
from .encoders.modules import GeneralConditioner
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\modules\encoders\modules.py", line 5, in
import kornia
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia_init_.py", line 8, in
from . import (
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\augmentation_init_.py", line 3, in
from kornia.augmentation.2d import (
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\augmentation_2d_init
.py", line 2, in
from kornia.augmentation.2d.intensity import *
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\augmentation_2d\intensity_init
.py", line 29, in
from kornia.augmentation.2d.intensity.plasma import RandomPlasmaBrightness, RandomPlasmaContrast, RandomPlasmaShadow
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\augmentation_2d\intensity\plasma.py", line 5, in
from kornia.contrib import diamond_square
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\contrib_init
.py", line 15, in
from .image_stitching import ImageStitcher
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\contrib\image_stitching.py", line 7, in
from kornia.feature import LocalFeatureMatcher, LoFTR
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\feature_init_.py", line 7, in
from .integrated import (
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\feature\integrated.py", line 17, in
from .lightglue import LightGlue
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\feature\lightglue.py", line 30, in
from flash_attn.modules.mha import FlashCrossAttention
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\flash_attn_init_.py", line 3, in
from flash_attn.flash_attn_interface import (
File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\flash_attn\flash_attn_interface.py", line 10, in
import flash_attn_2_cuda as flash_attn_cuda
ImportError: DLL load failed while importing flash_attn_2_cuda: The specified procedure could not be found.

Cannot import C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR module for custom nodes: DLL load failed while importing flash_attn_2_cuda: The specified procedure could not be found.

@dicksondickson
Copy link

dicksondickson commented Jul 6, 2024

@sdk401 Are you missing flash attention? Installing flash attention using their recompiled wheels via pip never worked for me on windows. Other's have reported the same: Dao-AILab/flash-attention#595

The only way I had it working was to compile my own. I have compile scripts here: https://github.com/dicksondickson/ComfyUI-Clean-Install

@sdk401
Copy link

sdk401 commented Jul 6, 2024

@sdk401 Are you missing flash attention?

Only if updating comfyui broke it. I installed it before for Lumina wrapper and it worked fine. Will try again.

@dicksondickson
Copy link

@sdk401 Are you missing flash attention?

Only if updating comfyui broke it. I installed it before for Lumina wrapper and it worked fine. Will try again.

As far as I know, ComfyUI doesn't install Flash Attention or updates Flash Attention. Comfy uses Flash Attention but doesn't require it. Although I could be wrong and my knowledge is outdated.

@kijai
Copy link
Owner

kijai commented Jul 6, 2024

Not working for me, not even importing, tried reinstalling, open-clip-torch is 2.24.0
1.2 seconds (IMPORT FAILED): C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR

Different error then, and that doesn't tell me anything, the real error is in the log somewhere.

here is the complete error, looks like something with flash-attn-cuda. worked fine yesterday

Traceback (most recent call last): File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\nodes.py", line 1907, in load_custom_node module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in call_with_frames_removed File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR__init.py", line 1, in from .nodes import SUPIR_Upscale File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR\nodes.py", line 11, in from .sgm.util import instantiate_from_config File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm__init.py", line 1, in from .models import AutoencodingEngine, DiffusionEngine File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\models__init.py", line 1, in from .autoencoder import AutoencodingEngine File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\models\autoencoder.py", line 12, in from ..modules.diffusionmodules.model import Decoder, Encoder File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\modules__init.py", line 1, in from .encoders.modules import GeneralConditioner File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\modules\encoders\modules.py", line 5, in import kornia File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia__init.py", line 8, in from . import ( File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\augmentation__init_.py", line 3, in from kornia.augmentation.2d import ( File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\augmentation_2d__init.py", line 2, in from kornia.augmentation.2d.intensity import * File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\augmentation_2d\intensity__init.py", line 29, in from kornia.augmentation._2d.intensity.plasma import RandomPlasmaBrightness, RandomPlasmaContrast, RandomPlasmaShadow File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\augmentation_2d\intensity\plasma.py", line 5, in from kornia.contrib import diamond_square File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\contrib__init.py", line 15, in from .image_stitching import ImageStitcher File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\contrib\image_stitching.py", line 7, in from kornia.feature import LocalFeatureMatcher, LoFTR File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\feature__init.py", line 7, in from .integrated import ( File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\feature\integrated.py", line 17, in from .lightglue import LightGlue File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\kornia\feature\lightglue.py", line 30, in from flash_attn.modules.mha import FlashCrossAttention File "C:sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\flash_attn__init.py", line 3, in from flash_attn.flash_attn_interface import ( File "C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\flash_attn\flash_attn_interface.py", line 10, in import flash_attn_2_cuda as flash_attn_cuda ImportError: DLL load failed while importing flash_attn_2_cuda: The specified procedure could not be found.

Cannot import C:_sd-win\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-SUPIR module for custom nodes: DLL load failed while importing flash_attn_2_cuda: The specified procedure could not be found.

I don't really know what's causing this, but as it seems to be related to kornia, I took a closer look at where it's used...... and realized it's not necessary. So I've removed it's import totally, if it doesn't clear the error, at very least the error should change now if you update and run.

@sdk401
Copy link

sdk401 commented Jul 7, 2024

I don't really know what's causing this, but as it seems to be related to kornia, I took a closer look at where it's used...... and realized it's not necessary. So I've removed it's import totally, if it doesn't clear the error, at very least the error should change now if you update and run.

Updated, error gone, nodes load, thanks!

@Vigilence
Copy link
Author

Update fixed the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants