Comfy-Org / comfy-cli

Command Line Interface for Managing ComfyUI
https://docs.comfy.org/comfy-cli/getting-started
GNU General Public License v3.0
218 stars 33 forks source link

Unable To install and run windows 11 -- torch #150

Open LucasMoskun opened 1 month ago

LucasMoskun commented 1 month ago

Describe the bug I follow the instructions to install and run from the readme

To Reproduce

python -m venv venv
.\venv\Scripts\activate
python -m pip install --upgrade pip
pip install comfy-cli
comfy --workspace=ComfyUI install
comfy set-default ComfyUI
comfy launch

Expected behavior I would expect comfyui to launch.

Actual behavior It fails to import torch

Launching ComfyUI from: C:\nilor-corp-temp\ComfyUI

[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2024-08-02 21:02:57.211501
** Platform: Windows
** Python version: 3.12.4 (tags/v3.12.4:8e8a4ba, Jun  6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)]
** Python executable: C:\nilor-corp-temp\venv\Scripts\python.exe
** ComfyUI Path: C:\nilor-corp-temp\ComfyUI
** Log path: C:\nilor-corp-temp\ComfyUI\comfyui.log

Prestartup times for custom nodes:
   0.9 seconds: C:\nilor-corp-temp\ComfyUI\custom_nodes\ComfyUI-Manager

Traceback (most recent call last):
  File "C:\nilor-corp-temp\ComfyUI\main.py", line 83, in <module>
    import comfy.utils
  File "C:\nilor-corp-temp\ComfyUI\comfy\utils.py", line 1, in <module>
    import torch
  File "C:\nilor-corp-temp\venv\Lib\site-packages\torch\__init__.py", line 148, in <module>
    raise err
OSError: [WinError 126] The specified module could not be found. Error loading "C:\nilor-corp-temp\venv\Lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.
CompletedProcess(args=['C:\\nilor-corp-temp\\venv\\Scripts\\python.exe', 'main.py'], returncode=1)

Additional context Add any other context about the problem here.

LucasMoskun commented 1 month ago

python: 3.12.4 cuda: 12.1

LucasMoskun commented 1 month ago

to get it to run I had to: run ComfyUI/main.py with the --windows-standalone-build as described here: https://github.com/comfyanonymous/ComfyUI/issues/3703#issuecomment-2253349160

And then uninstall torch: pip uninstall torch

then reinstall pytorch: pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 (https://pytorch.org/)

and then comfy launch works again.

robinjhuang commented 1 week ago

I believe this is because torch 2.40 was broken for windows. Should be fine now if you try it.

robinjhuang commented 1 week ago

Fixed in 2.4.1