ComfyUI-AnimateAnyone-Evolved icon indicating copy to clipboard operation
ComfyUI-AnimateAnyone-Evolved copied to clipboard

Torch not compiled with CUDA enabled

Open TomTomGit86 opened this issue 2 years ago • 16 comments

After installing animate anyone via comfyui, comfyui fails to stat giving this error message in the command window.

raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled

TomTomGit86 avatar Jan 30 '24 01:01 TomTomGit86

I managed to install Animate Anyone without that torch error now. Fresh Comfy install. Run update from update.bat (only Comfy), make sure the full path of X:\....\python_embeded\Scripts is added in PATH in environment variables. Run Comfy once and fully close it. Git clone the manager in the custom_nodes. Run Comfy, let it install. When done, fully close it and run again. Install AnimateAnyone-Evolved via manager. Again, when installed, restart Comfy. If it works, now it shouldn't error out

TomTomGit86 avatar Jan 30 '24 17:01 TomTomGit86

I managed to install Animate Anyone without that torch error now. Fresh Comfy install. Run update from update.bat (only Comfy), make sure the full path of X:\....\python_embeded\Scripts is added in PATH in environment variables. Run Comfy once and fully close it. Git clone the manager in the custom_nodes. Run Comfy, let it install. When done, fully close it and run again. Install AnimateAnyone-Evolved via manager. Again, when installed, restart Comfy. If it works, now it shouldn't error out

Yes this worked, didn't have to fully reinstall comfyui. Just added it to the PATH and then installed AnimateAnyone using the manager. Then restarted and getting no errors

Would you be so kind to tell us what did you do, exactly? What did you add to PATH in environment variables? Thanks.

corvo4791 avatar Jan 30 '24 23:01 corvo4791

If you search environment variables in Windows it should return the result for opening the windows settings to add environment variables in the top section (user) create/add a new PATH this can be given a name that you choose but set the directory as required X:....\python_embeded\Scripts The x represent your drive letter and the dots represent the directory where you have it installed. the last part is shown as it will be the same but the first part not as it will be different for each user. Once done this do as above on a fresh install of comfyui. Hope this helps. Screenshot_20240130-124137

TomTomGit86 avatar Jan 31 '24 11:01 TomTomGit86

If you search environment variables in Windows it should return the result for opening the windows settings to add environment variables in the top section (user) create/add a new PATH this can be given a name that you choose but set the directory as required X:....\python_embeded\Scripts The x represent your drive letter and the dots represent the directory where you have it installed. the last part is shown as it will be the same but the first part not as it will be different for each user. Once done this do as above on a fresh install of comfyui. Hope this helps.

Thanks, but, sadly, now I have a new error message:

Traceback (most recent call last): File "C:\code\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1893, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in call_with_frames_removed File "C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved_init.py", line 8, in module = importlib.import_module(f".{nodes_filename}", package=name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "importlib_init_.py", line 126, in import_module File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved\nodes.py", line 22, in from .src.models.unet_2d_condition import UNet2DConditionModel File "C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved\src\models\unet_2d_condition.py", line 40, in from .unet_2d_blocks import ( File "C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved\src\models\unet_2d_blocks.py", line 15, in from .transformer_2d import Transformer2DModel File "C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved\src\models\transformer_2d.py", line 7, in from diffusers.models.embeddings import PixArtAlphaTextProjection ImportError: cannot import name 'PixArtAlphaTextProjection' from 'diffusers.models.embeddings' (C:\code\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\models\embeddings.py)

Cannot import C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved module for custom nodes: cannot import name 'PixArtAlphaTextProjection' from 'diffusers.models.embeddings' (C:\code\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\models\embeddings.py)

corvo4791 avatar Jan 31 '24 14:01 corvo4791

I think you need to download the models required follow instructions in this video https://youtu.be/MGvx37ccCOM?si=rEvCba5wV57j8J9g

TomTomGit86 avatar Jan 31 '24 14:01 TomTomGit86

I think you need to download the models required follow instructions in this video https://youtu.be/MGvx37ccCOM?si=rEvCba5wV57j8J9g

I already have downloaded all the models

corvo4791 avatar Jan 31 '24 14:01 corvo4791

I think you need to download the models required follow instructions in this video https://youtu.be/MGvx37ccCOM?si=rEvCba5wV57j8J9g

I already have downloaded all the models

Did you do all these new steps on a fresh comfyui install?

TomTomGit86 avatar Jan 31 '24 17:01 TomTomGit86

I think you need to download the models required follow instructions in this video https://youtu.be/MGvx37ccCOM?si=rEvCba5wV57j8J9g

I already have downloaded all the models

Did you do all these new steps on a fresh comfyui install?

Yes, I did. Anyway, I solved here: https://github.com/MrForExample/ComfyUI-AnimateAnyone-Evolved/issues/15#issuecomment-1919179577

corvo4791 avatar Jan 31 '24 17:01 corvo4791

oh happy you got it solved, ohhhh this might solve my issue in nto beign able to pick a difrent sampler.

TomTomGit86 avatar Jan 31 '24 18:01 TomTomGit86

If anyone ever experiences the issue of Pytorch not being installed with Cuda (and you will :D it happens with many custom node installs), all you have to do is activate your ComfyUI virtual environment, then run the pip install command that's on the pytorch website for the correct version of pytorch with Cuda that you want.

https://pytorch.org/get-started/locally/

Cheers!

badgids avatar Jan 31 '24 23:01 badgids

Doing the diffusers update alone (linked by corvo above) seemed to solve it for me -- thanks to everyone here for your efforts.

alexanderdutton avatar Feb 01 '24 15:02 alexanderdutton

Is there a solution for all the mac user? As M1-M3 have no CUDA device, torch is compiled without CUDA extension. I get the error every time reaching the unet2d node.

nic0711 avatar Feb 04 '24 15:02 nic0711

Is there a solution for all the mac user? As M1-M3 have no CUDA device, torch is compiled without CUDA extension. I get the error every time reaching the unet2d node.

Hey! Yes. I found this solution that did the trick: #27

btech97 avatar Mar 29 '24 16:03 btech97

I am having same problem but I am using StabilityMatrix I have a conda environment comfyenv. I can't use comfy portable solution. How do I fix my comfyUI and is this really a solution? If the custom node is going to do this every time when it is installed. Does anyone know why this is happening? pytorch is supposed to be uninstalled during the custom node installation process, so why is it not completing the installation to complete custom node installation process. Unless I am wrong, which does happen.

ghost avatar Aug 14 '24 14:08 ghost