Closed KannManMachen closed 1 month ago
I believe I have the same error message. I am also on Windows 11, but I am not using portable version. Comfy is installed manually inside Conda environment.
Below are the commands I used.
I have successfully installed CUDA using:
conda install nvidia/label/cuda-12.1.1::cuda-toolkit
I have successfully installed PyTorch via:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
And I have xformers using:
pip install -U xformers --index-url https://download.pytorch.org/whl/cu121
Below is the log:
PS C:\Users\<USERNAME>\sd\ComfyUI> & C:/Users/<USERNAME>/anaconda3/envs/py311/python.exe c:/Users/<USERNAME>/sd/ComfyUI/main.py
** ComfyUI startup time: 2024-05-01 18:39:21.382339
** Platform: Windows
** Python version: 3.11.9 | packaged by Anaconda, Inc. | (main, Apr 19 2024, 16:40:41) [MSC v.1916 64 bit (AMD64)]
** Python executable: C:\Users\<USERNAME>\anaconda3\envs\py311\python.exe
** Log path: C:\Users\<USERNAME>\sd\ComfyUI\comfyui.log
Prestartup times for custom nodes:
0.3 seconds: C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI-Manager
Total VRAM 16379 MB, total RAM 16176 MB
xformers version: 0.0.26.post1
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4060 Ti : cudaMallocAsync
VAE dtype: torch.bfloat16
Using xformers cross attention
Traceback (most recent call last):
File "c:\Users\<USERNAME>\sd\ComfyUI\nodes.py", line 1864, in load_custom_node
module_spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI-3D-Pack\__init__.py", line 28, in <module>
module = importlib.import_module(f".{nodes_filename}", package=__name__)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\<USERNAME>\anaconda3\envs\py311\Lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 36, in <module>
from .algorithms.dmtet import DMTetMesh
File "C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI-3D-Pack\algorithms\dmtet.py", line 6, in <module>
from pytorch3d.loss import chamfer_distance, mesh_laplacian_smoothing
File "C:\Users\<USERNAME>\anaconda3\envs\py311\Lib\site-packages\pytorch3d\loss\__init__.py", line 8, in <module>
from .chamfer import chamfer_distance
File "C:\Users\<USERNAME>\anaconda3\envs\py311\Lib\site-packages\pytorch3d\loss\chamfer.py", line 11, in <module>
from pytorch3d.ops.knn import knn_gather, knn_points
File "C:\Users\<USERNAME>\anaconda3\envs\py311\Lib\site-packages\pytorch3d\ops\__init__.py", line 7, in <module>
from .ball_query import ball_query
File "C:\Users\<USERNAME>\anaconda3\envs\py311\Lib\site-packages\pytorch3d\ops\ball_query.py", line 10, in <module>
from pytorch3d import _C
ImportError: DLL load failed while importing _C: The specified procedure could not be found.
Cannot import C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI-3D-Pack module for custom nodes: DLL load failed while importing _C: The specified procedure could not be found.
### Loading: ComfyUI-Impact-Pack (V5.2)
### Loading: ComfyUI-Impact-Pack (Subpack: V0.5)
### Loading: ComfyUI-Inspire-Pack (V0.68)
[Impact Pack] Wildcards loading done.
### Loading: ComfyUI-Manager (V2.24.1)
### ComfyUI Revision: 2153 [2aed53c4] | Released on '2024-04-30'
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[tinyterraNodes] Loaded
WAS Node Suite: OpenCV Python FFMPEG support is enabled
WAS Node Suite: `ffmpeg_bin_path` is set to: C:/ProgramData/chocolatey/bin
WAS Node Suite: Finished. Loaded 211 nodes successfully.
"Art is the stored honey of the human soul." - Theodore Dreiser
Import times for custom nodes:
0.0 seconds: C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\websocket_image_save.py
0.0 seconds: C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI-Advanced-ControlNet
0.0 seconds: C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved
0.0 seconds: C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus
0.1 seconds: C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI-Inspire-Pack
0.4 seconds: C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI-Manager
0.6 seconds: C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI-Impact-Pack
0.9 seconds: C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI_tinyterraNodes
1.2 seconds (IMPORT FAILED): C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\ComfyUI-3D-Pack
2.2 seconds: C:\Users\<USERNAME>\sd\ComfyUI\custom_nodes\was-node-suite-comfyui
Starting server
To see the GUI go to: http://127.0.0.1:8188
(PS OP nice card! π€© )
I also encountered the same issue after upgrading my PyTorch version to 2.3.0.
@KannManMachen @TamakoT I fixed it, it works now! I have documented my every step, I will get back to you shortly, just need to type it up! :)
conda create --name py311
conda activate py311
If you are not using Anaconda, I suspect you would have something like venv that you create and activate (unless you have an existing one you want to use):
python -m venv py311
py311\Scripts\activate
conda install python=3.11.9
You already have Python, so you skip to Step 3.
We install CUDA toolkit, xformers and PyTorch in exactly that order.
conda config --add channels conda-forge
conda config --add channels pytorch
conda config --add channels nvidia
conda install -c "nvidia/label/cuda-12.1.1" cuda-toolkit
pip install -U xformers --index-url https://download.pytorch.org/whl/cu121
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
Without Conda, you need to use the installer to get CUDA-toolkit, I believe. Documentation says something about pip wheels, but I'm not sure if that version is enough for this repo. Here is link to documentation explaining it: https://docs.nvidia.com/cuda/archive/12.1.1/cuda-installation-guide-microsoft-windows/index.html
On Windows, there is only one way of getting xformers (that I am aware of), and that's using pip:
pip install -U xformers --index-url https://download.pytorch.org/whl/cu121
Get PyTorch by running:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install torchsde
git clone https://github.com/comfyanonymous/ComfyUI
Install the missing dependencies listed in requirements.txt
:
conda install einops sdy623::torchsde safetensors aiohttp pyyaml pillow scipy tqdm psutil kornia
Without conda, you just run pip install -r requirements.txt
.
git clone https://github.com/ltdrdata/ComfyUI-Manager
conda install GitPython PyGithub matrix_client transformers huggingface-hub
In custom_nodes
:
git clone https://github.com/ltdrdata/ComfyUI-Manager
conda install GitPython PyGithub matrix_client transformers huggingface-hub
(Venv)
You just run pip install -r requirements.txt
inside the manager folder.
Make sure this all runs by launching main.py
. Install anything else missing.
At this poing I stopped using conda for installations, and switched to pip. I used these commands:
(In custom_nodes
directory)
git clone https://github.com/MrForExample/ComfyUI-3D-Pack
(In ComfyUI-3D-Pack
directory)
pip install -r requirements.txt
pip install -r requirements_post.txt
And that's it. Second one took some time before the wheels got built. I think I will keep this verion of Comfy separate from the rest.
If you run pip list
, you can compare the versions you have installed to what I have (if this helps):
PS C:\Users\<USERNAME>\sd\ComfyUI> pip list
Package Version
--------------------------- ------------------
aiohttp 3.9.5
aiosignal 1.3.1
antlr4-python3-runtime 4.9.3
attrs 23.2.0
Brotli 1.1.0
certifi 2024.2.2
cffi 1.16.0
charset-normalizer 3.3.2
cmake 3.29.2
colorama 0.4.6
contourpy 1.2.1
cryptography 42.0.5
cycler 0.12.1
dataclasses-json 0.6.5
Deprecated 1.2.14
diff_gaussian_rasterization 0.0.0
diffusers 0.27.2
einops 0.8.0
executing 2.0.1
filelock 3.13.1
fonttools 4.51.0
frozenlist 1.4.1
fsspec 2024.2.0
ftfy 6.2.0
fvcore 0.1.5.post20221221
gitdb 4.0.11
GitPython 3.1.43
huggingface-hub 0.22.2
idna 3.7
imageio 2.34.1
imageio-ffmpeg 0.4.9
importlib_metadata 7.1.0
intel-openmp 2021.4.0
iopath 0.1.10
jaxtyping 0.2.28
Jinja2 3.1.3
joblib 1.4.0
kiui 0.2.8
kiwisolver 1.4.5
kornia 0.7.1
lazy_loader 0.4
markdown-it-py 3.0.0
MarkupSafe 2.1.5
marshmallow 3.21.1
matplotlib 3.8.4
matrix-client 0.4.0
mdurl 0.1.2
mkl 2021.4.0
mpmath 1.3.0
msvc-runtime 14.34.31931
multidict 6.0.5
mypy-extensions 1.0.0
nerfacc 0.5.3
networkx 3.2.1
ninja 1.11.1.1
numpy 1.26.3
nvdiffrast 0.3.1
objprint 0.2.3
omegaconf 2.3.0
open-clip-torch 2.24.0
opencv-python 4.9.0.80
packaging 24.0
pillow 10.3.0
pip 24.0
plyfile 1.0.3
pointnet2_ops 3.0.0
portalocker 2.8.2
protobuf 5.26.1
psutil 5.9.8
pycparser 2.22
PyGithub 2.3.0
pygltflib 1.16.2
Pygments 2.17.2
pyhocon 0.3.60
PyJWT 2.8.0
PyMCubes 0.1.4
pymeshlab 2023.12.post1
PyNaCl 1.5.0
pyparsing 3.1.2
PySocks 1.7.1
python-dateutil 2.9.0.post0
pytorch-msssim 1.0.0
pytorch3d 0.7.6
pywin32 306
PyYAML 6.0.1
regex 2024.4.28
requests 2.31.0
rich 13.7.1
roma 1.5.0
safetensors 0.4.3
scikit-learn 1.4.2
scipy 1.13.0
sentencepiece 0.2.0
setuptools 69.5.1
simple_knn 0.0.0
six 1.16.0
smmap 5.0.1
sympy 1.12
tabulate 0.9.0
tbb 2021.11.0
termcolor 2.4.0
threadpoolctl 3.5.0
timm 0.9.16
tokenizers 0.19.1
torch 2.3.0+cu121
torch_scatter 2.1.2
torchaudio 2.3.0
torchmcubes 0.1.0
torchsde 0.2.6
torchtyping 0.1.4
torchvision 0.18.0
tqdm 4.66.2
trampoline 0.1.2
transformers 4.40.1
trimesh 4.3.2
typeguard 2.13.3
typing_extensions 4.11.0
typing-inspect 0.9.0
urllib3 1.26.18
varname 0.13.0
wcwidth 0.2.13
wheel 0.43.0
win-inet-pton 1.1.0
wrapt 1.16.0
xatlas 0.0.9
xformers 0.0.26.post1
yacs 0.1.8
yarl 1.9.4
zipp 3.18.1
PS C:\Users\<USERNAME>\sd\ComfyUI>
Wow - thanks for the detailed answer and listing your installation steps :) !
You were kind enough to always differentiate between (conda) and (venv) in your instructions - do you think I can apply and use the steps you listed for (venv) for my portable ComfyUI version (Python Embedded Environment)? In other words, the "Python Embedded Environment" is a kind of virtual environment, right?
I will check the packages list first.
You suggested a specific order for step 3 - this seems to be crucial:
... can you explain why :) ?
My biggest question is actually: do I have to uninstall the already installed elements before I set it up again or is it enough (according to your list) to install or update the individual elements "over it"?
Cheers
That's a very important question (the last one). Hmm..
Tell you what, I'm feeling adventurous tonight. My 3D-Pack is now working, so I will try setting up venv on a side and see what happens!
As for the reason for the reason on why in that order - I tried it other way last time and it didn't work. π₯² Haha, as I said, I'm not really a programmer either.
Create a new folder and open a terminal there. Then clone the comfy repo:
git clone https://github.com/comfyanonymous/ComfyUI
and change directory:
cd ComfyUI
In here, we create environment and name it myVenv
:
python -m venv myVenv
Now, this is important. When you run pip list
, you should get a long list of packages you have. For example, I have:
Package Version
--------------------------- --------------------
absl-py 2.1.0
accelerate 0.29.3
addict 2.4.0
aiohttp 3.9.5
aiosignal 1.3.1
albumentations 1.4.4
annotated-types 0.6.0
antlr4-python3-runtime 4.9.3
anyio 4.3.0
attrs 23.2.0
Brotli 1.1.0
cachetools 5.3.3
certifi 2024.2.2
cffi 1.16.0
chardet 5.2.0
charset-normalizer 3.3.2
clip-interrogator 0.6.0
cmake 3.29.2
colorama 0.4.6
But when you activate your venv:
.\myVenv\Scripts\activate
Now, when you run pip list
, you should only have:
(myVenv) (pyDemo) C:\demoForKann\ComfyUI>pip list
Package Version
------------------------ ------------
pip 24.0
setuptools 65.5.0
This is how you will know you are in the separate environment, and not risking your functional environment that already works for you.
Then you install below, one at a time (I am following NVIDIA docs here):
python -m pip install wheel
python -m pip install nvidia-pyindex
python -m pip install nvidia-cuda-runtime-cu12
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
This last line of code will take some time (below is what you will likely see). Folder myVenv should end up having 4-6 GB by the end of it.
(myVenv) (pyDemo) C:\demoForKann\ComfyUI>python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
Looking in indexes: https://download.pytorch.org/whl/cu121, https://pypi.ngc.nvidia.com
Collecting torch
Downloading https://download.pytorch.org/whl/cu121/torch-2.3.0%2Bcu121-cp311-cp311-win_amd64.whl (2413.3 MB)
βββββββββββββββββββββββββΊβββββββββββββββ 1.5/2.4 GB 7.8 MB/s eta 0:02:01 βββββββββββββββββββββββββΈβββββββββββββββ 1.5/2.4 GB 7.7 MB/s eta 0:02:02 ββββββββββββββββββββββββββββΊββββββββββββ 1.6/2.4 GB 7.7 MB/s eta 0:01:41 ββββββββββββββββββββββββββββΊββββββββββββ 1.6/2.4 GB 7 βββββββββββββββββββββββββββββββββΈβββββββ 2.0/2.4 GB 7.7 MB/s eta 0:00:56
Now, when you run pip list
:
(myVenv) (pyDemo) C:\demoForKann\ComfyUI>pip list
Package Version
------------------------ ------------
filelock 3.13.1
fsspec 2024.2.0
intel-openmp 2021.4.0
Jinja2 3.1.3
MarkupSafe 2.1.5
mkl 2021.4.0
mpmath 1.3.0
networkx 3.2.1
numpy 1.26.3
nvidia-cuda-runtime-cu12 12.4.127
nvidia-pyindex 1.0.9
pillow 10.2.0
pip 24.0
setuptools 65.5.0
sympy 1.12
tbb 2021.11.0
torch 2.3.0+cu121
torchaudio 2.3.0+cu121
torchvision 0.18.0+cu121
typing_extensions 4.9.0
wheel 0.43.0
xformers 0.0.26.post1
(myVenv) (pyDemo) C:\demoForKann\ComfyUI>
And lastly, the xformers:
pip install -U xformers --index-url https://download.pytorch.org/whl/cu121
That's it for the environment setup. Then run Comfy's requirements:
python -m pip install -r requirements.txt
And now we check to see if Comfy works! Run this:
python main.py
On my end, Comfy works.
Do not close the terminal. You can press CTRL+C on your keyboard instead (this will ComfyUI without closing the terminal). If you accidentally close the terminal, it's not the end of the world, but you will need to activate your venv environment once again.
Then install the manager, and the requirements.txt
inside it. Run these (1 line at a time):
cd custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Manager
cd ComfyUI-Manager
python -m pip install -r requirements.txt
Then return to the root folder of Comfy:
cd ..
cd ..
And that's it! You now run python main.py
again. You should have the Comfy running, along with the Manager. Use manager to install 3D and it should work for you now.
As it currently stands, it is tiresome having to open the terminal each time, then cd
into the comfy folder, then activate venv, and then run python main.py
. Do this instead.
Create a shortcut of main.py
by right-clicking and dragging it to your desktop. Then right click on the shortcut and change the target
:
%windir%\System32\cmd.exe /K "C:\demoForKann\ComfyUI\myVenv\Scripts\activate.bat myVenv && python C:\demoForKann\ComfyUI\main.py"
The first line is your Command Prompt executable. You can figure out the rest, you just need to alter them so that they match your configuration.
I made a video explaining it (just need to rewind to the end, the part with the shortcuts):
If you can, leave my video a like and good luck! :)
Hey @Unboxed8941 thx again for this very detailed instruction, you are on fire! Happy to see that you as non-developer are getting really into this whole venv-library-dependencies-voodoo-game :D
So you created an venv in advanced β this time not with conda but with the help of python. I am happy to hear that this workflow seems to work fine as well. I will definitely try one of your two approaches, if I fail to achieve it with the native standalone installation of ComfyUI. Speaking of the portable version β I am pretty sure, that the portable version already works with its own pre-implemented venv structure:
C:\Users\<USERNAME>\Desktop\ComfyUI_windows_portable\python_embeded\python.exe
To run ComfyUI you will find the following parameters in the "run_nvidia_gpu.bat":
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
So I would love - if possible - to get the 3D pack working successfully together with the portable installation by finding the source of the error, so that other users (using the portable version) get a possible solution.
And if everything fails your tutorials will give the users a perfect alternative
Cheers
Run this, work for me: python_embeded\python.exe -m pip install -U xformers torch==2.2.1+cu121 pytorch3d
Hey @kitylam9, when I try to run β¦
C:\Users\<USERNAME>\Desktop\ComfyUI_windows_portable\python_embeded\python.exe -m pip install -U xformers torch==2.2.1+cu121 pytorch3d
β¦ I get the following message:
DEPRECATION: Loading egg at c:\users\<USERNAME>\desktop\comfyui_windows_portable\python_embeded\lib\site-packages\diff_gaussian_rasterization-0.0.0-py3.11-win-amd64.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330
DEPRECATION: Loading egg at c:\users\<USERNAME>\desktop\comfyui_windows_portable\python_embeded\lib\site-packages\nvdiffrast-0.3.1-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330
DEPRECATION: Loading egg at c:\users\<USERNAME>\desktop\comfyui_windows_portable\python_embeded\lib\site-packages\pointnet2_ops-3.0.0-py3.11-win-amd64.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330
DEPRECATION: Loading egg at c:\users\<USERNAME>\desktop\comfyui_windows_portable\python_embeded\lib\site-packages\simple_knn-0.0.0-py3.11-win-amd64.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330
Requirement already satisfied: xformers in c:\users\<USERNAME>\desktop\comfyui_windows_portable\python_embeded\lib\site-packages (0.0.26.post1)
ERROR: Could not find a version that satisfies the requirement torch==2.2.1+cu121 (from versions: 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.2.2, 2.3.0)
ERROR: No matching distribution found for torch==2.2.1+cu121
It finally works - no more "missing nodes" when loading the example workflows of the 3D-Pack!
Thank you very much @kitylam9 (and @Unboxed8941) β I had to change the command to:
C:\Users\<USERNAME>\Desktop\ComfyUI_windows_portable\python_embeded\python.exe -m pip install -U torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 xformers --index-url https://download.pytorch.org/whl/cu121
<3
Hello everyone,
unfortunately I can't get the 3D-Pack to work after several attempts and many hours of trying. When loading the workflows, all nodes are displayed as missing. As a non-developer, I have rummaged through the other Github issues to find potential sources of error - unfortunately without success. I'm afraid I've broken something in my many "repair attempts".
For the installation I followed the instructions "Install Method 0" (Directly inside ComfyUI Windows Python Embedded Environment).
I don't know if it is relevant, but I am using Windows Server 2022 (Version 21H2 (Build 20348.2402)).
What can I do? Do you need further information from me?
Cheers <3