卓特视觉
AI生成视频

ComfyUI插件ComfyUI_SLK_joy_caption_two节点报错JoyCaptionTwo module ‘bitsandbytes’ has no attribute ‘matmul_4bit’的解决办法

在运行ComfyUI_SLK_joy_caption_two插件使用工作流进行提示词反推时,这个插件报了一个错误:

JoyCaptionTwo

module ‘bitsandbytes’ has no attribute ‘matmul_4bit’

提示bitsandbytes中找不到matmul_4bit模块,具体错误代码部分如下:

File “G:\AIGC\ComfyUI-aki-v1.3\python\lib\site-packages\torch\nn\modules\module.py”, line 1736, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File “G:\AIGC\ComfyUI-aki-v1.3\python\lib\site-packages\torch\nn\modules\module.py”, line 1747, in _call_impl return forward_call(*args, **kwargs) File “G:\AIGC\ComfyUI-aki-v1.3\python\lib\site-packages\peft\tuners\lora\bnb.py”, line 496, in forward result = self.base_layer(x, *args, **kwargs) File “G:\AIGC\ComfyUI-aki-v1.3\python\lib\site-packages\torch\nn\modules\module.py”, line 1736, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File “G:\AIGC\ComfyUI-aki-v1.3\python\lib\site-packages\torch\nn\modules\module.py”, line 1747, in _call_impl return forward_call(*args, **kwargs) File “G:\AIGC\ComfyUI-aki-v1.3\python\lib\site-packages\accelerate\hooks.py”, line 169, in new_forward output = module._old_forward(*args, **kwargs) File “G:\AIGC\ComfyUI-aki-v1.3\python\bitsandbytes\bitsandbytes\nn\modules.py”, line 525, in forward return bnb.matmul_4bit(x, weight, bias=bias, quant_state=self.weight.quant_state).to(inp_dtype) AttributeError: module ‘bitsandbytes’ has no attribute ‘matmul_4bit’

解决方案:

升级或者降级到bitsandbytes-0.46.1版本,其他版本没有测试,该版本能满足大部分插件需求,所以测试成功运行!

但是我们需要使用预编译的whl轮子文件进行安装,轮子文件下载地址

https://pypi.org/project/bitsandbytes/#files

如果你是Windows系统,那你就下载bitsandbytes-0.46.1-py3-none-win_amd64.whl这个文件即可,下载完成后,使用命令安装。

假定我已经下载完成,将bitsandbytes-0.46.1-py3-none-win_amd64.whl文件放到了G:\AIGC\ComfyUI-aki-v1.3\python目录下,那我就在该文件夹上的地址栏输入CMD打开命令行,然后输入下面的命令进行安装

pip install bitsandbytes-0.46.1-py3-none-win_amd64.whl

安装完成之后,重启你的comfyui,这个报错就消失了,工作流也可以跑起来了!

ComfyUI插件ComfyUI_SLK_joy_caption_two节点报错JoyCaptionTwo module 'bitsandbytes' has no attribute 'matmul_4bit'的解决办法
© 版权声明

相关文章