chaojie / ComfyUI-Moore-AnimateAnyone

Apache License 2.0
211 stars 20 forks source link

install on windows #1

Open curlysasha opened 10 months ago

curlysasha commented 10 months ago

followed your instructions, but Screenshot_1

Kobak24 commented 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 "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "E:_AI\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone__init__.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?

curlysasha commented 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 "", 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

curlysasha commented 10 months ago

install via git link in manager then python tools/download_weights.py then restart server

working

mrkennypowers commented 10 months ago

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.

curlysasha commented 10 months ago

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

mrkennypowers commented 10 months ago

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

konradre commented 10 months ago

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?

curlysasha commented 10 months ago

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

konradre commented 10 months ago

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.

Kobak24 commented 10 months ago

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?

paulperrone commented 10 months ago

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

  1. Open up a new command line window.

  2. CD to the root directory of your ComfyUI installation

  3. Run the following command in the command line ...

python_embeded\python.exe -m pip install -r .\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\requirements.txt

  1. Download the weights.

python .\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\tools\download_weights.py

  1. 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

konradre commented 10 months ago

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

  1. Open up a new command line window.
  2. CD to the root directory of your ComfyUI installation
  3. Run the following command in the command line ...

python_embeded\python.exe -m pip install -r .\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\requirements.txt

  1. Download the weights.

python .\ComfyUI\custom_nodes\ComfyUI-Moore-AnimateAnyone\tools\download_weights.py

  1. 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

cardenluo commented 10 months ago

image

konradre commented 10 months ago

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

Ryugon07 commented 10 months ago

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!

howitzer99 commented 10 months ago

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.

ctankep commented 10 months ago
  1. The download_weights.py is using hf_hub_download helper.
  2. This creates a hidden .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.
  3. Though on starting " comfy ui " there's still another error since 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 :

image

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'