TMElyralab / Comfyui-MusePose

Other
287 stars 28 forks source link

Finally installed successfully on Windows, it's really a nightmare #27

Open huiyichanmian opened 4 weeks ago

huiyichanmian commented 4 weeks ago

Let me share my installation process below: Python version: 3.11.8 cuda : 12.1 Python executable: ComfyUI_windows_portable\python_embeded\python.exe torch version: 2.1.1+cu121 (Very important) xformers version: 0.0.23

torch url: https://pytorch.org/get-started/previous-versions/

Torch suggests choosing the same version as me, as the mmcv version requires 2.1.0,Torch 2.2. x and above versions do not have the corresponding mmcv version 2.1.0, which is not provided by the official and needs to be compiled by oneself. Compiling on your own is a bunch of unimaginable problems, so in order to reduce trouble for yourself.

After confirming all the above, you can install the project's dependency packages.

Note: You can choose to comment out the torch here, torchvision,xformers

pip install -r requirements.txt

Next, install openmim:

If you are using native comfyui, it may prompt a missing aliyunsdk,

pip install aliyun-python-sdk-core-v3==2.13.10

pip install --no-cache-dir -U openmim mim install mmengine

Now, please note not to use mim install "mmcv>=2.0.1".Do not use, do not use!

Next, please use the following command to install mmcv:

pip install mmcv==2.1.0 -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.1/index.html

Official page of mmcv:https://mmcv.readthedocs.io/zh-cn/latest/get_started/installation.html

Continue installing mmdet and mmpose now, please pay attention to the installation sequence.

mim install "mmdet>=3.1.0" mim install "mmpose>=1.1.0"

Do you remember we commented out xforms? Now we need to install xforms.

pip install xformers==0.0.23

Finally, start comfyui!!!

At the same time, I made a hand-to-hand deployment video, which can be referenced by students who need it.

https://www.bilibili.com/video/BV1H142127Zt/?pop_share=1&vd_source=b44c8fecb1353d20b573beb3d87fc159

image

rethink-studios commented 4 weeks ago

How would this solution work with python_embeded?

huiyichanmian commented 4 weeks ago

How would this solution work with python_embeded?

Method 1: You can add ComfyUI_windows_portable \ python_embeded \ python.exe to the system environment variable, so that you can use it directly. However, if you have other versions of Python in your system, I do not recommend doing so.

Method 2: You can directly enter the python_embeded directory and add pythn.exe -m before all commands.

When using the mim command, also add pythn.exe -m before it.

Note that when installing requirements. txt, please pay attention to the path, or you can copy this file to the current directory and then execute pythn.exe -m pip install -r requirements. txt

ioritree commented 4 weeks ago

thank you ,your method work on +cu121

minipuft commented 4 weeks ago

confirmed as working dindn't mess with any of my 50 custom nodes installed.

lulu-xiao commented 4 weeks ago

26 can change "mmdet/init.py" line9 "2.2.0" to "2.3.0" to forcely make it compatible

huiyichanmian commented 4 weeks ago

26 can change "mmdet/init.py" line9 "2.2.0" to "2.3.0" to forcely make it compatible

If the version is changed, it is easy to encounter a problem where 'Problem: name' init_detector 'is not defined`

xxinlei commented 3 weeks ago

Installed successfully but I keep getting this error..

RuntimeError: Error(s) in loading state_dict for CLIPVisionModelWithProjection:
        size mismatch for vision_model.embeddings.class_embedding: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([768]).
        size mismatch for vision_model.embeddings.patch_embedding.weight: copying a param with shape torch.Size([1024, 3, 14, 14]) from checkpoint, the shape in current model is torch.Size([768, 3, 32, 32]).
        size mismatch for vision_model.embeddings.position_embedding.weight: copying a param with shape torch.Size([257, 1024]) from checkpoint, the shape in current model is torch.Size([50, 768]).
        size mismatch for vision_model.pre_layrnorm.weight: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([768]).
        size mismatch for vision_model.pre_layrnorm.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([768]).
        size mismatch for vision_model.encoder.layers.0.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([768, 768]).
jaechanjo commented 2 weeks ago

Linux환경에서 위처럼 설정했는데, 에러가 발생합니다!

!!! Exception during processing !!! Traceback (most recent call last): File "/content/drive/MyDrive/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/content/drive/MyDrive/ComfyUI/execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "/content/drive/MyDrive/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(*slice_dict(input_data_all, i))) File "/content/drive/MyDrive/ComfyUI/custom_nodes/Comfyui-MusePose/nodes.py", line 563, in posealign_func return run_align_video_with_filterPose_translate_smooth(args) File "/content/drive/MyDrive/ComfyUI/custom_nodes/Comfyui-MusePose/nodes.py", line 285, in run_align_video_with_filterPose_translate_smooth detector = DWposeDetector( File "/content/drive/MyDrive/ComfyUI/custom_nodes/Comfyui-MusePose_old/pose/script/dwpose.py", line 75, in init self.pose_estimation = Wholebody(pose_config, pose_ckpt, device) File "/content/drive/MyDrive/ComfyUI/custom_nodes/Comfyui-MusePose_old/pose/script/wholebody.py", line 33, in init self.detector = init_detector(det_config, det_ckpt, device=device) File "/usr/local/lib/python3.10/dist-packages/mmdet/apis/inference.py", line 66, in init_detector model = MODELS.build(config.model) File "/usr/local/lib/python3.10/dist-packages/mmengine/registry/registry.py", line 570, in build return self.build_func(cfg, args, **kwargs, registry=self) File "/usr/local/lib/python3.10/dist-packages/mmengine/registry/build_functions.py", line 232, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "/usr/local/lib/python3.10/dist-packages/mmengine/registry/build_functions.py", line 100, in build_from_cfg raise KeyError( KeyError: 'TopdownPoseEstimator is not in the mmdet::model registry. Please check whether the value of TopdownPoseEstimator is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#import-the-custom-module'

marcusaureliusfun commented 1 week ago

Thank you, this worked for me. I prepended ......\python_embeded\python.exe -m to all the commands from inside the Musepose custom node directory. I was finally getting things installed.