chflame163 / ComfyUI_LayerStyle

A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
MIT License
1.19k stars 64 forks source link

ComfyUI is down after installation - How to reinstall it? #295

Open Pandor-AI opened 5 days ago

Pandor-AI commented 5 days ago

You proposed that I should use the command ../../../python_embeded/python.exe -s -m pip install torch==2.4.0 torchaudio==2.4.0 torchvision==0.19.0 -i https://download.pytorch.org/whl/cu12.6.4 and replacing the end number with the number of the driver of my Cuda.

I checked the version of the Cuda driver in the Nvidia Control Panel and it shows 12.6.65

I tried this

../../../python_embeded/python.exe -s -m pip install torch==2.4.0 torchaudio==2.4.0 torchvision==0.19.0 -i https://download.pytorch.org/whl/cu12.6.65 and get this result:

C:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_LayerStyle>python.exe -s -m pip install torch==2.4.0 torchaudio==2.4.0 torchvision==0.19.0 -i https://download.pytorch.org/whl/cu12.6 Looking in indexes: https://download.pytorch.org/whl/cu12.6, https://pypi.ngc.nvidia.com/ ERROR: Could not find a version that satisfies the requirement torch==2.4.0 (from versions: none) ERROR: No matching distribution found for torch==2.4.0

=================================

Then I tried ../../../python_embeded/python.exe -s -m pip install torch==2.4.0 torchaudio==2.4.0 torchvision==0.19.0 -i https://download.pytorch.org/whl/cu12.6.4 because it seems there's no wheel for my cuda 12.6.65 and I get this result:

Microsoft Windows [Versión 10.0.19045.3448] (c) Microsoft Corporation. Todos los derechos reservados.

C:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_LayerStyle>python.exe -s -m pip install torch==2.4.0 torchaudio==2.4.0 torchvision==0.19.0 -i https://download.pytorch.org/whl/cu124 Looking in indexes: https://download.pytorch.org/whl/cu124, https://pypi.ngc.nvidia.com/ Collecting torch==2.4.0 Downloading https://download.pytorch.org/whl/cu124/torch-2.4.0%2Bcu124-cp310-cp310-win_amd64.whl (2503.3 MB) ---------------------------------------- 2.5/2.5 GB 6.8 MB/s eta 0:00:00 Collecting torchaudio==2.4.0 Downloading https://download.pytorch.org/whl/cu124/torchaudio-2.4.0%2Bcu124-cp310-cp310-win_amd64.whl (4.1 MB) ---------------------------------------- 4.1/4.1 MB 8.2 MB/s eta 0:00:00 Collecting torchvision==0.19.0 Downloading https://download.pytorch.org/whl/cu124/torchvision-0.19.0%2Bcu124-cp310-cp310-win_amd64.whl (5.9 MB) ---------------------------------------- 5.9/5.9 MB 8.2 MB/s eta 0:00:00 Requirement already satisfied: filelock in c:\python310\lib\site-packages (from torch==2.4.0) (3.10.0) Requirement already satisfied: typing-extensions>=4.8.0 in c:\python310\lib\site-packages (from torch==2.4.0) (4.12.2) Requirement already satisfied: sympy in c:\python310\lib\site-packages (from torch==2.4.0) (1.11.1) Requirement already satisfied: networkx in c:\python310\lib\site-packages (from torch==2.4.0) (2.8.8) Requirement already satisfied: jinja2 in c:\python310\lib\site-packages (from torch==2.4.0) (3.1.2) Requirement already satisfied: fsspec in c:\python310\lib\site-packages (from torch==2.4.0) (2024.9.0) Requirement already satisfied: numpy in c:\python310\lib\site-packages (from torchvision==0.19.0) (2.1.1) Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in c:\python310\lib\site-packages (from torchvision==0.19.0) (10.4.0) Requirement already satisfied: MarkupSafe>=2.0 in c:\python310\lib\site-packages (from jinja2->torch==2.4.0) (2.1.1) Requirement already satisfied: mpmath>=0.19 in c:\python310\lib\site-packages (from sympy->torch==2.4.0) (1.2.1) Installing collected packages: torch, torchvision, torchaudio Attempting uninstall: torch Found existing installation: torch 2.4.1 Uninstalling torch-2.4.1: Successfully uninstalled torch-2.4.1 Attempting uninstall: torchvision Found existing installation: torchvision 0.19.1 Uninstalling torchvision-0.19.1: Successfully uninstalled torchvision-0.19.1 Attempting uninstall: torchaudio Found existing installation: torchaudio 2.4.1+cu124 Uninstalling torchaudio-2.4.1+cu124: Successfully uninstalled torchaudio-2.4.1+cu124 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. fairseq 0.12.2 requires omegaconf<2.1, but you have omegaconf 2.3.0 which is incompatible. Successfully installed torch-2.4.0+cu124 torchaudio-2.4.0+cu124 torchvision-0.19.0+cu124

C:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_LayerStyle>../../../python_embeded/python.exe -s -m pip install torch==2.4.0 torchaudio==2.4.0 torchvision==0.19.0 -i https://download.pytorch.org/whl/cu124 with cu124 ".." no se reconoce como un comando interno o externo, programa o archivo por lotes ejecutable.

C:\ComfyUI\ComfyUI\custom_nodes\ComfyUI_LayerStyle>cd /

C:>cd comf*

C:\ComfyUI>cd pyth*

C:\ComfyUI\python_embeded>python.exe -s -m pip install torch==2.4.0 torchaudio==2.4.0 torchvision==0.19.0 -i https://download.pytorch.org/whl/cu124 with cu124 Looking in indexes: https://download.pytorch.org/whl/cu124, https://pypi.ngc.nvidia.com/ Collecting torch==2.4.0 Downloading https://download.pytorch.org/whl/cu124/torch-2.4.0%2Bcu124-cp310-cp310-win_amd64.whl (2503.3 MB) ---------------------------------------- 2.5/2.5 GB 7.5 MB/s eta 0:00:00 Collecting torchaudio==2.4.0 Downloading https://download.pytorch.org/whl/cu124/torchaudio-2.4.0%2Bcu124-cp310-cp310-win_amd64.whl (4.1 MB) ---------------------------------------- 4.1/4.1 MB 7.5 MB/s eta 0:00:00 Collecting torchvision==0.19.0 Downloading https://download.pytorch.org/whl/cu124/torchvision-0.19.0%2Bcu124-cp310-cp310-win_amd64.whl (5.9 MB) ---------------------------------------- 5.9/5.9 MB 8.3 MB/s eta 0:00:00 ERROR: Could not find a version that satisfies the requirement with (from versions: none) ERROR: No matching distribution found for with

=====================================================================

Obviously I don't know what I'm doing, and don't understand the concept of dependencies yet or the mess of compatibilities between different versions. Or should I downgrade my cuda driver.. What to do next? Thanks for your help

=====================================================================

Python 3.10.9 Pytorch 2.4.1+cpu Xformers 0.0.27.post2 transformers 4.44.2 GPU Cuda not available torchvision 0.19.1+cpu Cuda 12.6.65

chflame163 commented 5 days ago

Yes, the highest CUDA version supported by Torch is 12.4, so installing this version is sufficient. Even if you install a higher version, it should still work properly.

Pandor-AI commented 4 days ago

Yes, Torch used to work with Cuda 12.6.65 until the failed installation. In fact I shouldn't have to install a downgraded Cuda but the reinstallation of pytorch torchaudio and torchvision didn't work. Or is there some other way to reestablish Comfy? I've been trying to find a nvidia driver that has Cuda 12.4 but not sure it works that way yet. My Nvidia driver's version is 560.94. Which one should be installed instead? Do you have any idea? It's easy to make things worse so I prefer to ask your opinion first. Is Cuda Toolbox of any use and how to use it? Thanks for your time

chflame163 commented 4 days ago

You can download the appropriate version of CUDA driver from https://developer.nvidia.com/cuda-toolkit-archive

Pandor-AI commented 4 days ago

Good! It's the same one I downloaded. Let's try it. I did everything and checked CUDA is enable, with CUDA12.4, and repeated the installation of torch, torchvision and torchaudio that was already completely installed. But I still cannot open ComfyUI. I just get a different outcome since now CUDA is available.

Version de CUDA

C:\Windows\System32>nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2024 NVIDIA Corporation Built on Tue_Feb_27_16:28:36_Pacific_Standard_Time_2024 Cuda compilation tools, release 12.4, V12.4.99 Build cuda_12.4.r12.4/compiler.33961263_0


Starting ComfyUI:

C:\ComfyUI>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --dont-upcast-attention --normalvram --output-directory=D:\@ComfyUI_ALL_MODELS\output\ --temp-directory=D:\@ComfyUI_ALL_MODELS\ [START] Security scan [DONE] Security scan

ComfyUI-Manager: installing dependencies done.

ComfyUI startup time: 2024-09-17 22:25:39.129201 Platform: Windows Python version: 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] Python executable: C:\ComfyUI\python_embeded\python.exe ComfyUI Path: C:\ComfyUI\ComfyUI Log path: C:\ComfyUI\comfyui.log

Prestartup times for custom nodes: 0.0 seconds: C:\ComfyUI\ComfyUI\custom_nodes\rgthree-comfy 0.0 seconds: C:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Easy-Use 1.9 seconds: C:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Manager

Traceback (most recent call last): File "C:\ComfyUI\ComfyUI\main.py", line 90, in import execution File "C:\ComfyUI\ComfyUI\execution.py", line 13, in import nodes File "C:\ComfyUI\ComfyUI\nodes.py", line 21, in import comfy.diffusers_load File "C:\ComfyUI\ComfyUI\comfy\diffusers_load.py", line 3, in import comfy.sd File "C:\ComfyUI\ComfyUI\comfy\sd.py", line 5, in from comfy import model_management File "C:\ComfyUI\ComfyUI\comfy\model_management.py", line 143, in total_vram = get_total_memory(get_torch_device()) / (1024 * 1024) File "C:\ComfyUI\ComfyUI\comfy\model_management.py", line 112, in get_torch_device return torch.device(torch.cuda.current_device()) File "C:\ComfyUI\python_embeded\lib\site-packages\torch\cuda__init.py", line 878, in current_device _lazy_init() File "C:\ComfyUI\python_embeded\lib\site-packages\torch\cuda\init__.py", line 305, in _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled

===============================================

What can I do next?

Pandor-AI commented 4 days ago

I decided to remove torch completely and then reinstall it again and also checked this:

print("Is CUDA enabled?", torch.cuda.is_available()) Is CUDA enabled? True

After reinstallation ComfyUI now works. Your help has been really useful. THANKS

Only a small detail you probably don't have to answer but I get those lines:

C:\ComfyUI\python_embeded\lib\site-packages\kornia\feature\lightglue.py:44: FutureWarning: torch.cuda.amp.custom_fwd(args...) is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda') instead. @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)

Is it something I should care about?

Thank you very much, this issue can be closed.

chflame163 commented 4 days ago

C:\ComfyUI\python_embeded\lib\site-packages\kornia\feature\lightglue.py:44: FutureWarning: torch.cuda.amp.custom_fwd(args...) is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda') instead. @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)

Is it something I should care about?

If ComfyUI run normally, there is no need to worry