Closed 0mil closed 2 months ago
It looks like your pytorch3d is not installed properly.
Here is the torch2.3.0 pytorch3d wheel in ...\ComfyUI\custom_nodes\ComfyUI-3D-Pack\_Pre_Builds\_Build_Wheels\_Wheels_win_py311_cu121
Try reinstall pytorch3d: ...\python.exe -m pip install --force-reinstall "...\ComfyUI\custom_nodes\ComfyUI-3D-Pack\_Pre_Builds\_Build_Wheels\_Wheels_win_py311_cu121\pytorch3d-0.7.7-cp311-cp311-win_amd64.whl"
I will update the video's description for the new update of torch2.4.0.
New ComfyUI has torch2.4.1 installed by default and it's just impossible to install 3D-Pack to portable.
New ComfyUI has torch2.4.1 installed by default and it's just impossible to install 3D-Pack to portable.
Install torch2.4.0 first
@AN3Orik If you run the: "Your comfyUI python.exe" install.py
it should automatically download everything in the correct version, so is reinstall from ComfyUI-Manager
@0mil ComfyUI-Manager should work for most cases, both torch2.3 and torch2.4 should work But in your case, you can try those two steps separately under ComfyUI-3D-Pack folder and see what other errors you got:
"Your comfyUI python.exe" -s -m pip -r requirements.txt
"Your comfyUI python.exe" install.py
@MrForExample It completley works. Thank you for your answering and awesome works. πππ
@0mil ComfyUI-Manager should work for most cases, both torch2.3 and torch2.4 should work But in your case, you can try those two steps separately under ComfyUI-3D-Pack folder and see what other errors you got:
"Your comfyUI python.exe" -s -m pip -r requirements.txt
"Your comfyUI python.exe" install.py
Hello @MrForExample , do you mean we must go to comfyui 3D pack folder under CUSTOM NODES, then open terminal and write this? "My_ComfyUI_path\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -s -m pip -r requirements.txt" ?? Please confirm
I tried it:
MyComfyUiPath\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack>"D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe" -s -m pip -r requirements.txt
and got: "no such option: -r"!
@GPU-server Yeah, you're almost there! However, there are a few typos. You have to execute the following command.
# first
MyComfyUiPath\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack>"D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe" -s -m pip install -r requirements.txt
# second
MyComfyUiPath\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack>"D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe" install.py
Hello again @0mil , since your last message (3H+ ago), I have been trying to install it :). Got SO many mistakes, erros, bugs. I tried so many things. 1) First, your solution (the one you mentioned just now). Result:
D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack>"D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe" install.py
Traceback (most recent call last):
File "D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\install.py", line 19, in <module>
from build_utils import (
File "D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\_Pre_Builds/_Build_Scripts\build_utils.py", line 54, in <module>
CUDA_VERSION = get_cuda_version()
^^^^^^^^^^^^^^^^^^
File "D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\_Pre_Builds/_Build_Scripts\build_utils.py", line 49, in get_cuda_version
raise RuntimeError(f"Please install/reinstall CUDA tookit with any of the following supported version: {build_config.supported_cuda_versions}")
RuntimeError: Please install/reinstall CUDA tookit with any of the following supported version: ['12.1', '11.8']
Traceback (most recent call last):
File "D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\install.py", line 19, in <module>
from build_utils import (
File "D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\_Pre_Builds/_Build_Scripts\build_utils.py", line 54, in <module>
CUDA_VERSION = get_cuda_version()
^^^^^^^^^^^^^^^^^^
File "D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\_Pre_Builds/_Build_Scripts\build_utils.py", line 49, in get_cuda_version
raise RuntimeError(f"Please install/reinstall CUDA tookit with any of the following supported version: {build_config.supported_cuda_versions}")
RuntimeError: Please install/reinstall CUDA tookit with any of the following supported version: ['12.1', '11.8']
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\install.py", line 84, in <module>
cstr("Comfy3D install failed: Dependency installation has failed. Please install manually: https://github.com/MrForExample/ComfyUI-3D-Pack/tree/main/_Pre_Builds/README.md.").error.print()
^^^^
NameError: name 'cstr' is not defined. Did you mean: 'str'?
In the meantime I figured I would try the WHEEL thing, I googled (meaning Used chatGPT) to understand what this is about. In summary, these are prechosen libraries that you can install.
2) So since my python inside Comfy embedded py was 3.11, I figured I must choose one of the 311 wheels.
Latest comfy comes up with 3.4.1 torch, but none of wheels were 341, So I went and did:
python install torch==2.4.0+cu121 torchvision==0.19.0+cu121 torchaudio==2.4.0 --extra-index-url https://download.pytorch.org/whl/cu121
Inside the embedded python directory.
But I did not perform a uninstall before it, I guess it was done automatically. (I actually did an unistall with :
pip uninstall torch torchvision torchaudio
But that uninstalled it from the BASE environement right? Anyway. (Forgot to do "python -m pip.." to make sure the embedded python is used)
Anyway upon rolling back I figured I could use these wheels right? https://github.com/MrForExample/Comfy3D_Pre_Builds/tree/main/_Build_Wheels/_Wheels_win_py311_torch2.4.0_cu121 To install them we do the same thing as you described in your comment: MyPathToMbedded\python.exe -m pip install --force-reinstall "pathToWheelFile1" And did it for all files.
When I did it for nvdiffrast I encountered this:
...
Successfully uninstalled numpy-1.26.4
WARNING: The scripts f2py.exe and numpy-config.exe are installed in 'D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
gpytoolbox 0.3.2 requires numpy<2, but you have numpy 2.1.2 which is incompatible.
numba 0.60.0 requires numpy<2.1,>=1.22, but you have numpy 2.1.2 which is incompatible.
Successfully installed numpy-2.1.2 nvdiffrast-0.3.1
(Notice the ERROR? Despite it saying success)
3) Then I launched comfy again, the import of 3D PACK showed "failed" again, I saw this in the logs related to comfy starting: ..ComfyUI-3D-Pack module for custom nodes: No module named 'torch_scatter' I did this:
python.exe -m pip install torch-scatter -f https://data.pyg.org/whl/torch-2.4.0+cu121.html
4) Launched again, it shows "failed", and logs show:
File "D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\numba__init__.py", line 45, in _ensure_critical_deps raise ImportError(msg) ImportError: Numba needs NumPy 2.0 or less. Got NumPy 2.1.
So I did this:
python.exe -m pip install numpy==2.0
here is how it went:
Collecting numpy==2.0
Using cached numpy-2.0.0-cp311-cp311-win_amd64.whl.metadata (60 kB)
Using cached numpy-2.0.0-cp311-cp311-win_amd64.whl (16.5 MB)
Installing collected packages: numpy
WARNING: The scripts f2py.exe and numpy-config.exe are installed in 'D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
gpytoolbox 0.3.2 requires numpy<2, but you have numpy 2.0.0 which is incompatible.
Successfully installed numpy-2.0.0
(Notice the ERROR despite success?)
5) Launched Comfy again -> failed. Logs show:
AttributeError: np.Inf
was removed in the NumPy 2.0 release. Use np.inf
instead.
Solution:
Went to this file "D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\gpytoolbox\reach_for_the_arcs.py" and mofidied all the lines with "np.Inf" into "np.inf".
6) Opened it again, failed. It shows: 'Python.h'Β : No such file or directory ninja: build stopped: subcommand failed. Solution (from here: https://github.com/MrForExample/ComfyUI-3D-Pack/issues/61)
Result: D:\NewInstalls\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\include\torch/csrc/python_headers.h(12): fatal error C1083: .... includeΒ : 'Python.h'Β : No such file or directory ninja: build stopped: subcommand failed.
I don't know what to do now. What do you think @MrForExample ? Am I crazy, should I had really to spend that much time and still not be able to install it?
Hello,
This custom_node is surprisingly awesome! However, it's extremely difficult to install successfully.
I have tried to install this custom_node using various configurations, including Ubuntu LTS, and Windows 10 with CUDA version 11.8 and 12.1. Currently, I am following the guide from this video, but I have also encountered the same failure with the installation of PyTorch3D.
Therefore, I sincerely request assistance: what is the best way to install this custom node using ComfyUI Manager or any other installation steps? Please provide the exact and specific requirements, including the supported OS, CUDA version, and Torch library version. I would like to try installing it again with the correct specifications. Thank you. πππ