Open curlysasha opened 10 months ago
got the same error:
File "E:_AI\ComfyUI\nodes.py", line 1872, in load_custom_node
module_spec.loader.exec_module(module)
File "
Cannot import E:_AI\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone module for custom nodes: cannot import name 'CaptionProjection' from 'diffusers.models.embeddings' (C:\Users****\AppData\Local\Programs\Python\Python311\Lib\site-packages\diffusers\models\embeddings.py)
I got this version of diffusers: Name: diffusers Version: 0.25.0
Have you tried the Tri fix button?
got the same error: File "E:_AI\ComfyUI\nodes.py", line 1872, 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 "E:_AI\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyoneinit.py", line 1, in from .nodes import NODE_CLASS_MAPPINGS File "E:_AI\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\nodes.py", line 22, in from src.models.unet_2d_condition import UNet2DConditionModel File "E:_AI\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\src\models\unet_2d_condition.py", line 40, in from .unet_2d_blocks import ( File "E:_AI\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\src\models\unet_2d_blocks.py", line 15, in from .transformer_2d import Transformer2DModel File "E:_AI\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\src\models\transformer_2d.py", line 7, in from diffusers.models.embeddings import CaptionProjection ImportError: cannot import name 'CaptionProjection' from 'diffusers.models.embeddings' (C:\Users****\AppData\Local\Programs\Python\Python311\Lib\site-packages\diffusers\models\embeddings.py)
Cannot import E:_AI\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone module for custom nodes: cannot import name 'CaptionProjection' from 'diffusers.models.embeddings' (C:\Users****\AppData\Local\Programs\Python\Python311\Lib\site-packages\diffusers\models\embeddings.py)
I got this version of diffusers: Name: diffusers Version: 0.25.0
Have you tried the Tri fix button?
yeah, tryied all buttons ) i think requirements need to be installed in venv, but i dont know how to do it in comfy
install via git link in manager then python tools/download_weights.py then restart server
working
install via git link in manager then python tools/download_weights.py then restart server
working
I wish this were true, but I've tried installing this way and every other way i can think of besides a brand new comfy ui installation and each time the nodes fail to load.
install via git link in manager then python tools/download_weights.py then restart server working
I wish this were true, but I've tried installing this way and every other way i can think of besides a brand new comfy ui installation and each time the nodes fail to load.
delete this node folder and try again
install via git link in manager then python tools/download_weights.py then restart server working
I wish this were true, but I've tried installing this way and every other way i can think of besides a brand new comfy ui installation and each time the nodes fail to load.
delete this node folder and try again
Yup, after moving the pretrained weights that worked. Ty
install via git link in manager then python tools/download_weights.py then restart server working
I wish this were true, but I've tried installing this way and every other way i can think of besides a brand new comfy ui installation and each time the nodes fail to load.
delete this node folder and try again
Yup, after moving the pretrained weights that worked. Ty
Where did you move the weights? I think what happens is if you downloaded them once theyre just simlinks to the cache on subsequent installs, so have to delete cache before attempting again. But you resolved it by moving the weights folder?
install via git link in manager then python tools/download_weights.py then restart server working
I wish this were true, but I've tried installing this way and every other way i can think of besides a brand new comfy ui installation and each time the nodes fail to load.
delete this node folder and try again
Yup, after moving the pretrained weights that worked. Ty
Where did you move the weights? I think what happens is if you downloaded them once theyre just simlinks to the cache on subsequent installs, so have to delete cache before attempting again. But you resolved it by moving the weights folder?
Simlink it ok
install via git link in manager then python tools/download_weights.py then restart server working
I wish this were true, but I've tried installing this way and every other way i can think of besides a brand new comfy ui installation and each time the nodes fail to load.
delete this node folder and try again
Yup, after moving the pretrained weights that worked. Ty
Where did you move the weights? I think what happens is if you downloaded them once theyre just simlinks to the cache on subsequent installs, so have to delete cache before attempting again. But you resolved it by moving the weights folder?
Simlink it ok
install via git link in manager then python tools/download_weights.py then restart server working
I wish this were true, but I've tried installing this way and every other way i can think of besides a brand new comfy ui installation and each time the nodes fail to load.
delete this node folder and try again
Yup, after moving the pretrained weights that worked. Ty
Where did you move the weights? I think what happens is if you downloaded them once theyre just simlinks to the cache on subsequent installs, so have to delete cache before attempting again. But you resolved it by moving the weights folder?
Simlink it ok
The fix doesnt work for me, no matter how many times I try it.
install via git link in manager then python tools/download_weights.py then restart server working
I wish this were true, but I've tried installing this way and every other way i can think of besides a brand new comfy ui installation and each time the nodes fail to load.
delete this node folder and try again
Yup, after moving the pretrained weights that worked. Ty
have you moved the pretrained weights somewhere? or you meant that you've removed and redownloaded them?
This worked for me, hope it helps.
TL;DR: On Windows use the python_embeded executable from the command line.
Prerequisite: Download ComfyUI-Moore-AnimateAnyone via the ComfyUI Manager or GitHub
Open up a new command line window.
CD to the root directory of your ComfyUI installation
Run the following command in the command line ...
python_embeded\python.exe -m pip install -r .\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\requirements.txt
python .\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\tools\download_weights.py
YOUR-COMFY-ROOT\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\pretrained_weights
This worked for me, hope it helps.
TL;DR: On Windows use the python_embeded executable from the command line.
Prerequisite: Download ComfyUI-Moore-AnimateAnyone via the ComfyUI Manager or GitHub
- Open up a new command line window.
- CD to the root directory of your ComfyUI installation
- Run the following command in the command line ...
python_embeded\python.exe -m pip install -r .\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\requirements.txt
- Download the weights.
python .\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\tools\download_weights.py
- Move the pretrained_weights dir from the root ComfyUI directory into the Moore-AnimateAnyone dir
YOUR-COMFY-ROOT\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\pretrained_weights
You sir, are legendary
Actually, moving the folder didnt seem to work for me, but installing the node through comfyUI manager, and the requirements.txt from comfyUI root folder fixed the 'Failed to Import' issue. But when moving pretrained weights folder from root after downloading weights, I got errors when trying to Queue Prompt. The solution in my case was to delete the weights folder again and run the .py file from the custom node AnimateAnyone folder.
To reiterate, the only solution I found was:
Download ComfyUI-Moore-AnimateAnyone via the ComfyUI Manager
Open up a new command line window.
CD to the root directory of your ComfyUI installation
Run the following command in the command line ...
python_embeded\python.exe -m pip install -r .\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\requirements.txt
CD to the ComfiUI-Moore-AnimateAnyone folder in your custom_nodes folder
Download the weights
python tools\download_weights.py
Actually, moving the folder didnt seem to work for me, but installing the node through comfyUI manager, and the requirements.txt from comfyUI root folder fixed the 'Failed to Import' issue. But when moving pretrained weights folder from root after downloading weights, I got errors when trying to Queue Prompt. The solution in my case was to delete the weights folder again and run the .py file from the custom node AnimateAnyone folder.
To reiterate, the only solution I found was:
Download ComfyUI-Moore-AnimateAnyone via the ComfyUI Manager
Open up a new command line window.
CD to the root directory of your ComfyUI installation
Run the following command in the command line ...
python_embeded\python.exe -m pip install -r .\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\requirements.txt
CD to the ComfiUI-Moore-AnimateAnyone folder in your custom_nodes folder
Download the weights
python tools\download_weights.py
Thanks Sire!
I've followed the steps above, and it's not working for me. I keep getting the 'Failed to Import' error in the startup console, and the ComfyUI Manager still shows (IMPORT FAILED) in the Install Missing Plugins window.
download_weights.py
is using hf_hub_download
helper..cache/huggingface
folder in your root then attempts to symlink back to it. Its a bit of a mess so I just manually created the pretrained_models
folder. Then added the correct " animate anyone " models there.os_path
is returning double backslashes. Thats concatenated with forward slashes in the hard coded linux path. The install could be made a lot simpler and the start up check for pretrained_models
folder needs to be fixed as well ..Line 29 in nodes.py
:
The comfy_path
is correct ,
Logging that out it prints the correct slashes :
C:\Users\username\Documents\Repo\ComfyUI
But when concatenated ,
With the f - string in python its messed up :
C:\\Users\\username\\Documents\\Repo\\ComfyUI/custom_nodes/ComfyUI-Moore-AnimateAnyone/pretrained_weights
The loading error :
Traceback (most recent call last):
File "C:\Users\username\Documents\Repo\ComfyUI\nodes.py", line 1893, in load_custom_node
module_spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\username\Documents\Repo\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\__init__.py", line 1, in <module>
from .nodes import NODE_CLASS_MAPPINGS
File "C:\Users\username\Documents\Repo\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\nodes.py", line 30, in <module>
pretrained_weights=os.listdir(pretrained_weights_path)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\username\\Documents\\Repo\\ComfyUI/custom_nodes/ComfyUI-Moore-AnimateAnyone/pretrained_weights'
followed your instructions, but