comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
52.32k stars 5.52k forks source link

Python Path #3607

Closed Robson1970 closed 3 months ago

Robson1970 commented 4 months ago

"D:\a\ComfyUI\python_embbeded\python.exe"

Not a real bug, but something changed the Python Path to "D:\a\ComfyUI\python_embbeded\python.exe"

The Path is not mine, I have to change it again.

Phyton

The-Administrator commented 4 months ago

I have encountered this before because the downloaded Windows portable version of Confyui comes with a built-in pip.

python_embeded There is one get-pip.py

python -m uninstall pip
python get-pip.py

PIP may download some site-packages to the C drive. To avoid this situation, I referred to the environment.bat of AUTOMATIC1111 and created a more convenient and user-friendly .bat file

Create comfyui-py.bat

set DIR=%~dp0ComfyUI_windows_portable
set PY_DIR=%DIR%\python_embeded
set PATH=%PY_DIR%;%PY_DIR%\Scripts;%PY_DIR%\Lib\site-packages;%PATH%
set PY_LIBS=%PY_DIR%\Lib;%PY_DIR%\Lib\site-packages
set PY_PIP=%PY_DIR%\Scripts
set PIP_INSTALLER_LOCATION=%PY_DIR%\get-pip.py
cd %DIR%
cmd /k

Can be modified according to your path

If there are many Python virtual environments on the computer, you can refer to the approach of AUTOMATIC1111 and set up the environment.bat before running nvidia_gpu.bat or run_cpu.bat