Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few suggestions for updating repo instructions for new users (and xformers instructions for AI video projects) #3793

Open
brentjohnston opened this issue Jun 20, 2024 · 0 comments

Comments

@brentjohnston
Copy link

brentjohnston commented Jun 20, 2024

I'll create a new pull request for the readme but just wanted to put this here in case anyone needs help.

My friend did not want to use the portable version of Comfyui. Because some extensions needing whl that didn't exist and requiring includes that aren't present in the portable package. He didn't want to mess with constantly changing windows path to python to match embedded comfyui when build a whl.

I was helping him with his new Windows gaming laptop and he kept getting this typical error which I knew how to fix:
AssertionError: Torch not compiled with CUDA enabled

He said the repo instructions didn't help him. Don't ask me how he knows how to build a whl, but couldn't get past this..

I told him he needed to install cuda 12.1 from nvidia First. Then do the pip uninstall torch stuff, then run pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121 again, which would then download the correct whl because cuda toolkit 12.1 was now installed.

He mentioned he wanted to use Tooncrafter, So I told him it's best to use that with xformers for that, so it's 2.3.0 for xformers currently and this should work for him to install xformers and it did:

pip uninstall torch

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

pip install xformers --no-deps

pip uninstall numpy
pip install numpy==1.26.4

And for portable version of xformers: python_embeded\python.exe -m pip install xformers --no-deps

Anyways, the only thing main page says for windows install is:

Troubleshooting

If you get the "Torch not compiled with CUDA enabled" error, uninstall torch with:

pip uninstall torch

And install it again with the command above.

So I would suggest this:

#### Troubleshooting

If you get the "Torch not compiled with CUDA enabled" error:

Install [Cuda Toolkit 12.1 for Windows, or current ComfyUI recommended version.](https://developer.nvidia.com/cuda-12-1-0-download-archive?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_local)

```pip uninstall torch```

`pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121` again. (cu121 mean Cuda 12.1) It will download the correct WHL.

And for people that need xformers for AI video related things:

### Xformers

`xformers` is utilized to improve performance and memory efficiency for large models and long sequences. It is effective in projects requiring optimized spatiotemporal attention, such as:

Examples:
- *Tooncrafter*
- *Comfy-SVDTools Extension*

These example projects benefit from `xformers` through its efficient handling of attention mechanisms in extensive spatiotemporal data.

**Note:** ComfyUI does not include `xformers` by default. You will need to install it separately if you need this.

```pip uninstall torch```

```pip install torch==2.3.0+cu121 torchvision==0.18.0+cu121 torchaudio==2.3.0+cu121 --extra-index-url https://download.pytorch.org/whl/cu121```

```pip install xformers --no-deps```

```pip uninstall numpy```
```pip install numpy==1.26.4```

or for ComfyUI portable version ```python_embeded\python.exe -m pip install xformers --no-deps```

Also since Comfyui is very popular. I would also maybe suggest adding info on installing the Python Windows installer for new users, and for users that don't want to use portable, making sure tell them to ADD TO SYSTEM PATH CHECKED on the first screen, then doing python -m venv venv in ComfyUI folder after the git clone, or whatever, explaining this create a virtual environement. Typing activate in the scripts folder or the shortcut way to activate. pip install -r requirements.txt Installing Cuda Toolkit 12.1. etc. just to make the barrier to entry bit less for regular version.

The portable is good too though, but I also had some of those issues with certain extensions and trying to use cmake to build a whl and xformers did not work for me at all for portable. It gets complicated if the python embedded is different version than your windows environmental variables PATH of python when trying to build a whl for portable version.

Hope these suggestions help and make sense.

brentjohnston added a commit to brentjohnston/ComfyUI-Video-Focused that referenced this issue Jun 20, 2024
Updated troubleshooting section and xformers installation info for AI Video related project as per comfyanonymous#3793
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant