Can we not default to installing the CPU version of 'torch torchvision torchauudio'
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 153
Description
### Custom Node Testing
- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)
### Expected Behavior
Start COMFYUI normally
### Actual Behavior
COMFYUI cannot start
### Steps to Reproduce
My native language is Chinese, and this issue is the result of my translation using a translation software. I apologize that it may not be very accurate.
The problem I encountered is that when I upgrade COMFYUI and its dependencies using the "update_comfyui_1d_python_deependencies. bat" file in the "update" folder, by default, the original torch torch torch vision torch studio three dependencies will be uninstalled and only the CPU version will be reinstalled. This will cause my COMFYUI to not start properly, and I need to reinstall the corresponding GPU version, such as "Python-m pip install torch torch vision torch studio -- index url" https://download.pytorch.org/whl/cu126 ”.
I don't think this is a good upgrade method. Can we change it to first check whether the original version is the CPU or GPU version, and if it is the GPU version, reinstall it with the GPU version still installed?
### Debug Logs
```powershell
D:\ComfyUI>set PHONEMIZER_ESPEAK_PATH=.\UDH-eSpeakNG
D:\ComfyUI>set ESPEAK_DATA_PATH=.\UDH-eSpeakNG\espeak-ng-data
D:\ComfyUI>set PHONEMIZER_ESPEAK_LIBRARY=.\UDH-eSpeakNG\libespeak-ng.dll
D:\ComfyUI>set MBROLA_PATH=.\UDH-eSpeakNG\mbrola
D:\ComfyUI>set MBROLA_LIBRARY_PATH=.\UDH-eSpeakNG\mbrola\mbrola.lib
D:\ComfyUI>set NUNCHAKU_LOAD_METHOD=READ
D:\ComfyUI>set NUMEXPR_MAX_THREADS=32
D:\ComfyUI>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --listen 192.168.0.100 --front-end-version Comfy-Org/ComfyUI_frontend@latest --use-sage-attention --reserve-vram 1
Adding extra search path checkpoints D:\sd-webui-aki-v4.4\models\Stable-diffusion
Adding extra search path configs D:\sd-webui-aki-v4.4\models\Stable-diffusion
Adding extra search path vae D:\sd-webui-aki-v4.4\models\VAE
Adding extra search path loras D:\sd-webui-aki-v4.4\models\Lora
Adding extra search path loras D:\sd-webui-aki-v4.4\models\LyCORIS
Adding extra search path upscale_models D:\sd-webui-aki-v4.4\models\ESRGAN
Adding extra search path upscale_models D:\sd-webui-aki-v4.4\models\RealESRGAN
Adding extra search path upscale_models D:\sd-webui-aki-v4.4\models\SwinIR
Adding extra search path upscale_models D:\sd-webui-aki-v4.4\models\upscale_models
Adding extra search path embeddings D:\sd-webui-aki-v4.4\embeddings
Adding extra search path hypernetworks D:\sd-webui-aki-v4.4\models\hypernetworks
Adding extra search path controlnet D:\sd-webui-aki-v4.4\models\ControlNet
Adding extra search path ipadapter D:\sd-webui-aki-v4.4\models\ipadapter
Adding extra search path inpaint D:\sd-webui-aki-v4.4\models\inpaint
Adding extra search path gligen D:\sd-webui-aki-v4.4\models\gligen
[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2025-06-10 23:44:51.177
** Platform: Windows
** Python version: 3.12.7 (tags/v3.12.7:0b05ead, Oct 1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]
** Python executable: D:\ComfyUI\python_embeded\python.exe
** ComfyUI Path: D:\ComfyUI\ComfyUI
** ComfyUI Base Folder Path: D:\ComfyUI\ComfyUI
** User directory: D:\ComfyUI\ComfyUI\user
** ComfyUI-Manager config path: D:\ComfyUI\ComfyUI\user\default\ComfyUI-Manager\config.ini
** Log path: D:\ComfyUI\ComfyUI\user\comfyui.log
Prestartup times for custom nodes:
0.0 seconds: D:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Easy-Use
0.0 seconds: D:\ComfyUI\ComfyUI\custom_nodes\rgthree-comfy
7.0 seconds: D:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Manager
Checkpoint files will always be loaded safely.
Traceback (most recent call last):
File "D:\ComfyUI\ComfyUI\main.py", line 130, in
import execution
File "D:\ComfyUI\ComfyUI\execution.py", line 13, in
import nodes
File "D:\ComfyUI\ComfyUI\nodes.py", line 22, in
import comfy.diffusers_load
File "D:\ComfyUI\ComfyUI\comfy\diffusers_load.py", line 3, in
import comfy.sd
File "D:\ComfyUI\ComfyUI\comfy\sd.py", line 7, in
from comfy import model_management
File "D:\ComfyUI\ComfyUI\comfy\model_management.py", line 221, in
total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\ComfyUI\comfy\model_management.py", line 172, in get_torch_device
return torch.device(torch.cuda.current_device())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\python_embeded\Lib\site-packages\torch\cuda\__init__.py", line 1026, in current_device
_lazy_init()
File "D:\ComfyUI\python_embeded\Lib\site-packages\torch\cuda\__init__.py", line 363, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
D:\ComfyUI>pause
```
### Other
My native language is Chinese, and this issue is the result of my translation using a translation software. I apologize that it may not be very accurate.
The problem I encountered is that when I upgrade COMFYUI and its dependencies using the "update_comfyui_1d_python_deependencies. bat" file in the "update" folder, by default, the original torch torch torch vision torch studio three dependencies will be uninstalled and only the CPU version will be reinstalled. This will cause my COMFYUI to not start properly, and I need to reinstall the corresponding GPU version, such as "Python-m pip install torch torch vision torch studio -- index url" https://download.pytorch.org/whl/cu126 ”.
I don't think this is a good upgrade method. Can we change it to first check whether the original version is the CPU or GPU version, and if it is the GPU version, reinstall it with the GPU version still installed?
Contributor guide
Assessment
This issue has not been assessed yet.