heshengtao / comfyui_LLM_party

Dify in ComfyUI includes Omost,GPT-sovits, ChatTTS,GOT-OCR2.0, and FLUX prompt nodes,access to Feishu,discord,and adapts to all llms with similar openai/gemini interfaces, such as o1,ollama, qwen, GLM, deepseek, moonshot,doubao. Adapted to local llms, vlm, gguf such as llama-3.2, Linkage neo4j KG, graphRAG / RAG / html 2 img
GNU Affero General Public License v3.0
923 stars 89 forks source link

ModuleNotFoundError: No module named 'jax.numpy'; 'jax' is not a package #35

Open Pythonpa opened 3 months ago

Pythonpa commented 3 months ago

When started the latest version,it shows this error message,and my jax of ComfyUI venv is 0.4.30. I have reinstall jax & jaxlib,but still have the same error................

Traceback (most recent call last): File "C:\ComfyUI\nodes.py", line 1931, 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:\ComfyUI\custom_nodes\comfyui_LLM_party__init.py", line 8, in from .llm import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "C:\ComfyUI\custom_nodes\comfyui_LLM_party\llm.py", line 1873, in load_custom_tools() File "C:\ComfyUI\custom_nodes\comfyui_LLM_party\llm.py", line 1851, in load_custom_tools spec.loader.exec_module(module) File "C:\ComfyUI\custom_nodes\comfyui_LLM_party\custom_tool\chatTTS_node.py", line 4, in import ChatTTS File "C:\ComfyUI\python\lib\site-packages\ChatTTS__init__.py", line 1, in from .core import Chat File "C:\ComfyUI\python\lib\site-packages\ChatTTS\core.py", line 18, in from .model import DVAE, GPT, gen_logits File "C:\ComfyUI\python\lib\site-packages\ChatTTS\model__init.py", line 1, in from .dvae import DVAE File "C:\ComfyUI\python\lib\site-packages\ChatTTS\model\dvae.py", line 9, in from vector_quantize_pytorch import GroupedResidualFSQ File "C:\ComfyUI\python\lib\site-packages\vector_quantize_pytorch\init__.py", line 2, in from vector_quantize_pytorch.residual_vq import ResidualVQ, GroupedResidualVQ File "C:\ComfyUI\python\lib\site-packages\vector_quantize_pytorch\residual_vq.py", line 18, in from einx import get_at File "C:\ComfyUI\python\lib\site-packages\einx\init.py", line 5, in from . import backend File "C:\ComfyUI\python\lib\site-packages\einx\backend\init__.py", line 1, in from .register import register_for_module, register, get, backends, numpy File "C:\ComfyUI\python\lib\site-packages\einx\backend\register.py", line 53, in register_for_module("jax", _jax.create) File "C:\ComfyUI\python\lib\site-packages\einx\backend\register.py", line 19, in register_for_module register(backend_factory()) File "C:\ComfyUI\python\lib\site-packages\einx\backend_jax.py", line 11, in create import jax.numpy as jnp ModuleNotFoundError: No module named 'jax.numpy'; 'jax' is not a package

heshengtao commented 3 months ago

The current vector_quantize_pytorch no longer rely on jax, I think you can try to update the version of vector_quantize_pytorch, or directly update the version of chatTTS

Pythonpa commented 3 months ago

The current vector_quantize_pytorch no longer rely on jax, I think you can try to update the version of vector_quantize_pytorch, or directly update the version of chatTTS

ok,the version of ChatTTS and vector-quantize-pytorch, both of them are the latest, ChatTTS==0.1.1 vector-quantize-pytorch=1.15.3. By the way, my OS is Windows 10, torch=2.3.0,CUDA=12.1. Could it be related to incompatible system versions?

guobalove commented 3 months ago

I noticed that the file paths in your einx folder are different from mine, so I checked the version of my einx library and found it's 0.3.0.

Pythonpa commented 3 months ago

I noticed that the file paths in your einx folder are different from mine, so I checked the version of my einx library and found it's 0.3.0.

Weird,my einx also is 0.3.0

[SD-Launcher] C:\ComfyUI>C:\ComfyUI\python\python.exe -m pip show einx Name: einx Version: 0.3.0 Summary: Universal Tensor Operations in Einstein-Inspired Notation for Python Home-page: https://github.com/fferflo/einx Author: Florian Fervers Author-email: florian.fervers@gmail.com License: MIT Location: c:\comfyui\python\lib\site-packages Requires: frozendict, numpy, sympy Required-by: vector-quantize-pytorch

heshengtao commented 3 months ago

My system is Win11, and everything else is the same as you. There is no jax library in my environment. But I can run normally.After I tried to install jax & jaxlib, it can also run, that is to say, whether there is jax & jaxlib or not will not affect the operation of chatTTS. If you don't need to use chatTTS, you can directly delete C:\ ComfyUI\ custom_nodes\ comfyui_LLM_party\ custom_tool\ chatTTS_node.py, this error will disappear.

Pythonpa commented 3 months ago

My system is Win11, and everything else is the same as you. There is no jax library in my environment. But I can run normally.After I tried to install jax & jaxlib, it can also run, that is to say, whether there is jax & jaxlib or not will not affect the operation of chatTTS. If you don't need to use chatTTS, you can directly delete C:\ ComfyUI\ custom_nodes\ comfyui_LLM_party\ custom_tool\ chatTTS_node.py, this error will disappear.

ok, thanks,will have a try.

Pythonpa commented 3 months ago

My system is Win11, and everything else is the same as you. There is no jax library in my environment. But I can run normally.After I tried to install jax & jaxlib, it can also run, that is to say, whether there is jax & jaxlib or not will not affect the operation of chatTTS. If you don't need to use chatTTS, you can directly delete C:\ ComfyUI\ custom_nodes\ comfyui_LLM_party\ custom_tool\ chatTTS_node.py, this error will disappear.

I found this issues about jax ,maybe is related to einx\tracer

heshengtao commented 3 months ago

It is very likely that another person has reported the same error, and his computer has a dependency that contains a file called jax.py, while mine does not.

fferflo commented 3 months ago

It looks like the traceback of the error is in a codepath that can only execute if "jax" in sys.modules. So likely there is a module with name "jax" that has already been imported, such as a file jax.py, but it is not the Jax library itself. You could check which file has been imported

>>> sys.modules["jax"]
<module 'jax' from '.../site-packages/jax/__init__.py'>

and whether importing Jax manually gives the same error:

import jax.numpy as jnp
heshengtao commented 3 months ago

In the latest version of my node, I import jax before importing chatTTS, which avoids einx importing jax. I hope this fixes your problem. If there is still an error, my node library will block the import of chatTTS without affecting the use of other nodes.

Pythonpa commented 3 months ago

The PARTY node can now be started and used normally, but after observing the startup logs, it is actually running by blocking the import of chatTTS. image

heshengtao commented 3 months ago

This bug has been unable to be reproduced due to multiple of our computers. If you don't need the chatTTS function for the time being, it may take us a long time to solve this problem. Thank you very much for your feedback. We will notify you immediately when we solve the problem.

heshengtao commented 3 months ago

https://github.com/jtydhr88/ComfyUI-Unique3D/issues/8#issuecomment-2201885173 Referring to this answer, jax was disabled by the autumn leaf package. We can reproduce this bug on the autumn leaf package. If you need to use chatTTS, you can use the original comfyui to start, or use the iron pot to start. 参考这个回答,jax被秋叶包给禁用了,我们在秋叶包上可以复现这个BUG,如果你需要使用chatTTS,可以使用原版comfyui启动,或者使用铁锅炖启动。

Pythonpa commented 3 months ago

jtydhr88/ComfyUI-Unique3D#8 (comment) Referring to this answer, jax was disabled by the autumn leaf package. We can reproduce this bug on the autumn leaf package. If you need to use chatTTS, you can use the original comfyui to start, or use the iron pot to start. 参考这个回答,jax被秋叶包给禁用了,我们在秋叶包上可以复现这个BUG,如果你需要使用chatTTS,可以使用原版comfyui启动,或者使用铁锅炖启动。

Okay, I will try using the Docker version of comfyui later to see if there will be any problems

fferflo commented 3 months ago

The problem should also be fixed with the latest source version of einx (see this commit), so you could try updating einx:

pip install --upgrade git+https://github.com/fferflo/einx.git
BertWang commented 2 months ago

果然.秋叶包的問題。國內大都還是分二大主流.秋叶包/铁锅炖啓動。看來要美好體驗..只能走向.. 铁锅炖启动。在掛回秋叶包