ComfyUI-3D-Pack
ComfyUI-3D-Pack copied to clipboard
torch torchvision torchaudio xformers pytorch3d ninja nvdiffrast C++ _C image2mvimage image2normal
I am very grateful to the developers of the project.
However, due to the complexity of the functionality and dependencies on various libraries, the installation process is not easy (2.5 days (〒︿〒) ). Here's a summary of the issues encountered:
-
Matching the core library versions (the idea is to uninstall first, then install): The following versions were tested and found to be working with my Python 3.11:
"%python_exec%" -s -m pip uninstall torch torchvision torchaudio xformers "%python_exec%" -s -m pip install torch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0 xformers==0.0.24 --index-url https://download.pytorch.org/whl/cu121 -
Pytorch3d is difficult to install: First, uninstall the current version:
XXXX \ComfyUI_windows_portable\python_embeded\python.exe -m pip uninstall pytorch3dThen find the corresponding version in a collection of Wheel files and install it:
https://miropsota.github.io/torch_packages_builder/pytorch3d/ XXXX\ComfyUI_windows_portable\python_embeded python.exe -m pip install YYYY\pytorch3d-0.7.7+pt2.3.0cu121-cp311-cp311-win_amd64.whl -
Fix conflicts and missing dependencies until most library issues are resolved:
XXX \ComfyUI_windows_portable\python_embeded\python.exe -m pip check pip install *n -
Install ninja and add ninja to the environment variable path:
ComfyUI_windows_portable\python_embeded\Lib\site-packages\ninja\data\bin -
The most troublesome errors are with nvdiffrast: Ensure that Cuda Torch and nvdiffrast versions do not conflict. First, uninstall nvdiffrast:
XXX\ComfyUI_windows_portable\python_embeded\python.exe -m pip uninstall nvdiffrast git clone https://github.com/NVlabs/nvdiffrast cd nvdiffrast XXX\ComfyUI_windows_portable\python_embeded\python.exe -m pip install .You might fail to install. Remember to remove the "import nvdiffrast" line from
nvdiffrast\setup.py. I don't know why this line is there. -
Besides successfully installing libraries, configuring the CUDA, cuDNN environment, and Visual Studio's C++ support is also crucial:
- For CUDA, it's best to match your computer's environment to version 12.1.
- cuDNN: Download the zip from the official site, then copy the files from the bin, include, and lib directories to the corresponding CUDA 12.1 locations. For me, it was
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1. - Visual Studio C++: Go to the VS installer and install "Desktop development with C++". I also installed the 2019 MSVC because I heard the latest version might be incompatible.
Also, it's important to add CUDA and VS paths to the Path environment variable. Mine were:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\libnvvp D:\Program_Files\Heavy\VScode2022\VC\Tools\MSVC\14.37.32822\bin\Hostx64\x64 D:\Workshop\ComfyUI_windows_portable\python_embeded\Lib\site-packages\ninja\data\binA troublesome point is that even if you add the MSVC path to Path, nvdiffrast might still not find it. I forcibly added the path in the library's
__init__.py(atComfyUI_windows_portable\python_embeded\Lib\site-packages\nvdiffrast):__version__ = '0.3.1' import os vs_path = r"D:\Program_Files\Heavy\VScode2022\VC\Tools\MSVC\14.37.32822\bin\Hostx64\x64" if vs_path not in os.environ['PATH']: os.environ['PATH'] += ';' + vs_path print(f"Added {vs_path} to PATH") -
Wuvin\Unique3D's image2mvimage and image2normal: It's best to directly download the complete version from Hugging Face and replace it in the custom nodes, rather than downloading models one by one. The original configuration seeks bin files, not safetensors, and the complete download is unified. After downloading, you may need to rename
img2mvimgtoimage2mvimageso that ComfyUI can recognize it.
I seem to have got everything running now, but the VRAM isn't enough. I'll try a different card tomorrow.
Everyone's issues might be different. The versions of the libraries are crucial, and the support for VS C++ and CUDA installation on your computer must match.
Good luck!
Thanks for written this guide, and apologize for didn't address those install issue sooner
Have you tried the new install.py script or install from ComfyUI-Manager? And if you want to build all the packages yourself, have you checked the steps I took for build all wheels on Ubuntu?
Thank you for the reply; I just found out that you have also prepared these auxiliary documents. I am developing Unity and ComfyUI integration, and my main job is game development, so I am also a novice in configuring the Python environment.
Looking back, I frequently encountered issues such as not finding _C during import and nvfiffrast not finding C++. This requires checking the compatibility between library versions, whether the libraries are intact, and whether the CUDA, cuDNN, and VS C++ support in the system are also matched and added to the path. Additionally, the most frustrating part was that, in the end, I had to forcibly add the path in the init to make nvfiffrast find C++. I couldn't figure out why it couldn't find the path when the system already had it; I always thought it was a version compatibility issue.
But as long as the direction of thinking is correct, similar problems will be easier to solve.
I once tried downloading the new comfyui_portable and then installing all the necessary nodes from the missing nodes in ComfyUI-Manager, but it seems that I still encountered issues with the [3d-pack] nodes not loading. From my impression, it was due to errors caused by pytorch3d.
Thank you for the reply; I just found out that you have also prepared these auxiliary documents.感谢您的回复;我刚刚发现你也准备了这些辅助文件。 I am developing Unity and ComfyUI integration, and my main job is game development, so I am also a novice in configuring the Python environment.我正在开发Unity和ComfyUI集成,我的主要工作是游戏开发,所以我也是配置Python环境的新手。
Looking back, I frequently encountered issues such as not finding _C during import and nvfiffrast not finding C++. This requires checking the compatibility between library versions, whether the libraries are intact, and whether the CUDA, cuDNN, and VS C++ support in the system are also matched and added to the path.回想起来,我经常遇到导入过程中找不到_C和nvfiffrast找不到C++等问题。这需要检查库版本之间的兼容性,库是否完好无损,以及系统中的 CUDA、cuDNN 和 VS C++ 支持是否也匹配并添加到路径中。 Additionally, the most frustrating part was that, in the end, I had to forcibly add the path in the init to make nvfiffrast find C++. I couldn't figure out why it couldn't find the path when the system already had it; I always thought it was a version compatibility issue.此外,最令人沮丧的部分是,最后,我不得不在 init 中强行添加路径以使 nvfiffrast 找到 C++。我不明白为什么当系统已经有路径时,它找不到路径;我一直以为是版本兼容性问题。
But as long as the direction of thinking is correct, similar problems will be easier to solve
hey ,dear,Sounds Like You're working on a plugin to project comfyui-generated maps to your model?I already had solutions.
Thank you for the reply; I just found out that you have also prepared these auxiliary documents.感谢您的回复;我刚刚发现你也准备了这些辅助文件。 I am developing Unity and ComfyUI integration, and my main job is game development, so I am also a novice in configuring the Python environment.我正在开发Unity和ComfyUI集成,我的主要工作是游戏开发,所以我也是配置Python环境的新手。 Looking back, I frequently encountered issues such as not finding _C during import and nvfiffrast not finding C++. This requires checking the compatibility between library versions, whether the libraries are intact, and whether the CUDA, cuDNN, and VS C++ support in the system are also matched and added to the path.回想起来,我经常遇到导入过程中找不到_C和nvfiffrast找不到C++等问题。这需要检查库版本之间的兼容性,库是否完好无损,以及系统中的 CUDA、cuDNN 和 VS C++ 支持是否也匹配并添加到路径中。 Additionally, the most frustrating part was that, in the end, I had to forcibly add the path in the init to make nvfiffrast find C++. I couldn't figure out why it couldn't find the path when the system already had it; I always thought it was a version compatibility issue.此外,最令人沮丧的部分是,最后,我不得不在 init 中强行添加路径以使 nvfiffrast 找到 C++。我不明白为什么当系统已经有路径时,它找不到路径;我一直以为是版本兼容性问题。 But as long as the direction of thinking is correct, similar problems will be easier to solve
hey ,dear,Sounds Like You're working on a plugin to project comfyui-generated maps to your model?I already had solutions.
Hello, sounds great. What I am currently working on is an AI-based 3D scene editing and painting system in VR. In the future, I will apply similar technology to game development. My development relies on the strong community support of ComfyUI and the generative capabilities of AI, but the construction of the functional system is still on Unity.
Thank you for the reply; I just found out that you have also prepared these auxiliary documents.感谢您的回复;我刚刚发现你也准备了这些辅助文件。 I am developing Unity and ComfyUI integration, and my main job is game development, so I am also a novice in configuring the Python environment.我正在开发Unity和ComfyUI集成,我的主要工作是游戏开发,所以我也是配置Python环境的新手。感谢您的回复;我刚刚发现你也准备了这些辅助文件。我刚刚发现你也准备了这些辅助文件。我正在开发Unity和ComfyUI集成,我的主要工作是游戏开发,所以我也是配置Python环境的新手。 Looking back, I frequently encountered issues such as not finding _C during import and nvfiffrast not finding C++. This requires checking the compatibility between library versions, whether the libraries are intact, and whether the CUDA, cuDNN, and VS C++ support in the system are also matched and added to the path.回想起来,我经常遇到导入过程中找不到_C和nvfiffrast找不到C++等问题。这需要检查库版本之间的兼容性,库是否完好无损,以及系统中的 CUDA、cuDNN 和 VS C++ 支持是否也匹配并添加到路径中。 Additionally, the most frustrating part was that, in the end, I had to forcibly add the path in the init to make nvfiffrast find C++. I couldn't figure out why it couldn't find the path when the system already had it; I always thought it was a version compatibility issue.此外,最令人沮丧的部分是,最后,我不得不在 init 中强行添加路径以使 nvfiffrast 找到 C++。我不明白为什么当系统已经有路径时,它找不到路径;我一直以为是版本兼容性问题。 But as long as the direction of thinking is correct, similar problems will be easier to solve但只要思维方向正确,类似的问题就更容易解决
hey ,dear,Sounds Like You're working on a plugin to project comfyui-generated maps to your model?I already had solutions.嘿,亲爱的,听起来你正在开发一个插件来将 comfyui 生成的地图投影到你的模型上?我已经有了解决方案。
Hello, sounds great. 你好,听起来不错。 What I am currently working on is an AI-based 3D scene editing and painting system in VR. In the future, I will apply similar technology to game development. My development relies on the strong community support of ComfyUI and the generative capabilities of AI, but the construction of the functional system is still on Unity.我目前正在研究的是基于AI的VR中的3D场景编辑和绘画系统。未来,我会将类似的技术应用到游戏开发中。我的开发依赖于 ComfyUI 强大的社区支持和 AI 的生成能力,但功能系统的构建仍然依赖于 Unity。
Actually, I solved it in Unreal Engine.The main part of my work is JSON serialization and websocket. In fact, comfyui is still a framework I need to rely on.I guess this idea will help you.
It's a beginner's nightmare.Many things do not know what is, and the final effect does not match the cost of learning.
Why is this so impossible to install?