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
55.86k stars 5.89k forks source link

Problem Starting ComfyUI on Ubuntu #2418

Open ckao10301 opened 10 months ago

ckao10301 commented 10 months ago

According to instructions, I'm supposed to run python main.py. I get an error.

ckao1030@ckao1030-OMEN-by-HP-45L-Gaming-Desktop-GT22-0xxx:~/Desktop/ComfyUI$ python main.py Command 'python' not found, did you mean: command 'python3' from deb python3 command 'python' from deb python-is-python3

Th3Rom3 commented 10 months ago

So how far did you get in the install section from the instructions? Were you able to run any pip commands in order to install the prerequisites?

You can check which files are connected to the shell commands with which

which python which python3

which python might return something like /usr/bin/which: no python in $PATH

You can try running it with python3 which will probably use the system python environment (you can check that with above commands).

ckao10301 commented 10 months ago

I completed the install according to instructions for Linux and Nvidia below. I will try the commands you suggested.

Git clone this repo. Installed Python 10.6 manually.

NVIDIA Nvidia users should install stable pytorch using this command:

pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121

Dependencies Install the dependencies by opening your terminal inside the ComfyUI folder and:

pip install -r requirements.txt

After this you should have everything installed and can proceed to running ComfyUI.

ckao10301 commented 10 months ago

which python doesn't return anything. why is that? I'm using Mint Linux and installed python using the terminal. running python3 main.py worked.

log:

image

By the way, how did you get your syntax to show up like this in comments (with the grey background and different font)? image

ltdrdata commented 10 months ago

Use venv instead of system python. System python makes many issues.

ckao10301 commented 10 months ago

I googled it and figured out how to use venv python. @comfyanonymous can we add instructions on how to install venv python on linux as part of the installation steps? It would really help beginners like me using linux for the first time

neohopeUA commented 9 months ago

Hi @ckao10301 I'm sorry to bother you but I'm also running Linux Mint with a 3060Ti and seem to have run into the same issue as you when trying to run and install ComfyUI, I can get Automatic1111 working fine. Would you be able to let me know the steps you took to get it working?

Th3Rom3 commented 9 months ago

If you set up Comfy with git clone you will need to provide your own Python environment as it is not embedded like in the portable Windows version.

This can be done with e.g. Python venv or (Ana)Conda environments

https://python.land/virtual-environments/virtualenv#How_a_Python_venv_works https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

If you have set up Automatic1111 according to its manual Linux installation on the same machine you can try running

python3 -m venv ComfyPython source ComfyPython/bin/activate

This will create a folder and virtual python environment named ComfyPython at the point of your terminal (use ~/ComfyPython to create it in the root of your home folder) and subsequently activate it. be advised that all python code run until you deactivate it again will use this environment unless otherwise specified.

ckao10301 commented 8 months ago

Hi @ckao10301 I'm sorry to bother you but I'm also running Linux Mint with a 3060Ti and seem to have run into the same issue as you when trying to run and install ComfyUI, I can get Automatic1111 working fine. Would you be able to let me know the steps you took to get it working?

  1. go to the comfyui folder and open terminal
  2. source venv/bin/activate
  3. python main.py