Your content here
COMFY="$HOME/ComfyUI-Installs/ComfyUI/ComfyUI"
VENV="$COMFY/.venv/bin/python3"
nvidia-smi
python --version
"$VENV" -c "import torch; print('PyTorch:',torch.__version__); print('CUDA:',torch.version.cuda); print('CUDA available:',torch.cuda.is_available()); print('GPU:',torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'unavailable'); print('Supported architectures:',torch.cuda.get_arch_list() if torch.cuda.is_available() else 'unavailable'); x=torch.randn(512,512,device='cuda'); print((x@x).shape)"
cat "$COMFY"/.venv/pyvenv.cfg
"$VENV" -m pip freeze > ~/comfyui-packages-before-fix.txt
"$VENV" -m pip install \
--force-reinstall \
torch==2.7.1 torchvision==0.22.1 \
--index-url https://download.pytorch.org/whl/cu126
"$VENV" -c "import torch; print('PyTorch:',torch.__version__); print('CUDA:',torch.version.cuda); print('CUDA available:', torch.cuda.is_available()); print('GPU:',torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'unavailable'); print('Supported architectures:', torch.cuda.get_arch_list() if torch.cuda.is_available() else 'unavailable'); x=torch.randn(512,512,device='cuda'); print((x@x).shape)"