ComfyUI-PhotoMaker-ZHO icon indicating copy to clipboard operation
ComfyUI-PhotoMaker-ZHO copied to clipboard

(IMPORT FAILED): \ComfyUI\custom_nodes\ComfyUI-PhotoMaker

Open zhoobin021 opened this issue 1 year ago • 20 comments

I tried reinstalling, I did git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker.git and also did 'pip install -r requirements.txt' inside 'custom_nodes/ComfyUI-PhotoMaker'

even did git pull in 'custom_nodes/ComfyUI-PhotoMaker' folder and It says it's already up to date. but still getting the '(IMPORT FAILED): \ComfyUI\custom_nodes\ComfyUI-PhotoMaker' error and the nodes inside the 'PhotoMaker_locally【Zho】.json' workflow are red and undefined.

please help. thank you.

zhoobin021 avatar Jan 19 '24 17:01 zhoobin021

do a "pip install -r requirements.txt" in the CustomUI-PhotoMaker" folder

This will get you your missing nodes

GraftingRayman avatar Jan 19 '24 18:01 GraftingRayman

do a "pip install -r requirements.txt" in the CustomUI-PhotoMaker" folder

This will get you your missing nodes

I did do that, it didn't work.

zhoobin021 avatar Jan 19 '24 22:01 zhoobin021

It's not working because you are using the portable version and it is installing the requirements in the wrong folders. Type this in the CustomUI-PhotoMaker folder and change the path to python embedded to the path on your pc

E:\SD\comfy2\ComfyUI_windows_portable\python_embeded\python.exe -s -m pip install -r ./requirements.txt

cvar66 avatar Jan 19 '24 22:01 cvar66

Am also getting this error, am using ComfyUI via Stability Matrix and ran through the steps as indicates but the nodes fail to load.

prosperinweb avatar Jan 19 '24 23:01 prosperinweb

Yep the commits in the last 24 hours broke the nodes.

Just checkout to yesterdays commit 349f577 for now and use the v2.0 workflows: PhotoMaker_fromhub【Zho】.json PhotoMaker_locally【Zho】.json

cd custom_nodes/ComfyUI-PhotoMaker && git checkout 349f577

ceramicwhite avatar Jan 20 '24 02:01 ceramicwhite

2024-01-20_073507 2024-01-20_073610

ponponych avatar Jan 20 '24 04:01 ponponych

@ponponych Screenshot 2024-01-19 at 9 21 05 PM You've got something else going on, check your logs.

ceramicwhite avatar Jan 20 '24 05:01 ceramicwhite

Traceback (most recent call last): File "F:\ComfyUI\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 "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-PhotoMaker_init.py", line 1, in from .PhotoMakerNode import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-PhotoMaker\PhotoMakerNode.py", line 4, in from diffusers.utils import load_image ModuleNotFoundError: No module named 'diffusers' FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json

Cannot import F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-PhotoMaker module for custom nodes: No module named 'diffusers'

ponponych avatar Jan 20 '24 05:01 ponponych

@ponponych run pip install -r requirements.txt inside F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-PhotoMaker

ceramicwhite avatar Jan 20 '24 05:01 ceramicwhite

Launched. All the same. ComfyUI portable ** Platform: Windows ** Python version: 3.11.6

ponponych avatar Jan 20 '24 05:01 ponponych

So I also ran the pip command and it this is a snippet of where the dependencies installed. Is the path maybe the problem?

ofent@Prosper MINGW64 ~/AppData/Roaming/StabilityMatrix/Packages/ComfyUI/custom_nodes/ComfyUI-PhotoMaker (main)
$ pip install -r requirements.txt
Requirement already satisfied: diffusers==0.25.0 in c:\users\ofent\miniconda3\lib\site-packages (from -r requirements.txt (line 1)) (0.25.0)
Requirement already satisfied: transformers==4.36.2 in c:\users\ofent\miniconda3\lib\site-packages (from -r requirements.txt (line 2)) (4.36.2)
Requirement already satisfied: huggingface-hub==0.20.2 in c:\users\ofent\miniconda3\lib\site-packages (from -r requirements.txt (line 3)) (0.20.2)

prosperinweb avatar Jan 20 '24 12:01 prosperinweb

https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker/issues/15#issuecomment-1898701609

This comment probably has the solution. It did for me. Hope that helps.

leifniem avatar Jan 20 '24 16:01 leifniem

#15 (comment)

This comment probably has the solution. It did for me. Hope that helps.

Yes, thank you, this worked!

just to make sure everyone can do it:

-go to ComfyUI\custom_nodes directory and in the search bar of the folder type cmd and press enter. -paste this : git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker.git -press enter -then go to ComfyUI_windows_portable\python_embeded directory and in the search bar of the folder type cmd and press enter. -paste this : python.exe -m pip install -r path_to_requirements -replace path_to_requirements with the directory of requirements.txt wherever your comfyui is installed, e.g. D:\ComfyUI\custom_nodes\ComfyUI-PhotoMaker\requirements.txt. together it should look similar like this :

python.exe -m pip install -r D:\ComfyUI\custom_nodes\ComfyUI-PhotoMaker\requirements.txt.

-press enter and wait a bit, -then restart comfyui and test to see if the nodes are activated.

zhoobin021 avatar Jan 20 '24 17:01 zhoobin021

I tried reinstalling, I did git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker.git and also did 'pip install -r requirements.txt' inside 'custom_nodes/ComfyUI-PhotoMaker'

even did git pull in 'custom_nodes/ComfyUI-PhotoMaker' folder and It says it's already up to date. but still getting the '(IMPORT FAILED): \ComfyUI\custom_nodes\ComfyUI-PhotoMaker' error and the nodes inside the 'PhotoMaker_locally【Zho】.json' workflow are red and undefined.

please help. thank you.

same problem

hidogo avatar Jan 21 '24 05:01 hidogo

2024-01-20_073507 2024-01-20_073610

Having the same problem

hidogo avatar Jan 21 '24 05:01 hidogo

same problem

Check the comment right above yours

leifniem avatar Jan 21 '24 08:01 leifniem

#15 (comment) This comment probably has the solution. It did for me. Hope that helps.

Yes, thank you, this worked!

just to make sure everyone can do it:

-go to ComfyUI\custom_nodes directory and in the search bar of the folder type cmd and press enter. -paste this : git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker.git -press enter -then go to ComfyUI_windows_portable\python_embeded directory and in the search bar of the folder type cmd and press enter. -paste this : python.exe -m pip install -r path_to_requirements -replace path_to_requirements with the directory of requirements.txt wherever your comfyui is installed, e.g. D:\ComfyUI\custom_nodes\ComfyUI-PhotoMaker\requirements.txt. together it should look similar like this :

python.exe -m pip install -r D:\ComfyUI\custom_nodes\ComfyUI-PhotoMaker\requirements.txt.

-press enter and wait a bit, -then restart comfyui and test to see if the nodes are activated.

I tried that but the Photomaker Generation node is still missing. The problem must be for those (like me) with a portable version. Something isn't installing properly.

LuisBurdallo avatar Jan 21 '24 19:01 LuisBurdallo

Anyone with this problem watch this video cause it helped me solve that problem.

https://www.youtube.com/watch?v=yjCa9WALzAs

LuisBurdallo avatar Jan 21 '24 20:01 LuisBurdallo

#15 (comment) This comment probably has the solution. It did for me. Hope that helps.

Yes, thank you, this worked! just to make sure everyone can do it: -go to ComfyUI\custom_nodes directory and in the search bar of the folder type cmd and press enter. -paste this : git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker.git -press enter -then go to ComfyUI_windows_portable\python_embeded directory and in the search bar of the folder type cmd and press enter. -paste this : python.exe -m pip install -r path_to_requirements -replace path_to_requirements with the directory of requirements.txt wherever your comfyui is installed, e.g. D:\ComfyUI\custom_nodes\ComfyUI-PhotoMaker\requirements.txt. together it should look similar like this : python.exe -m pip install -r D:\ComfyUI\custom_nodes\ComfyUI-PhotoMaker\requirements.txt. -press enter and wait a bit, -then restart comfyui and test to see if the nodes are activated.

I tried that but the Photomaker Generation node is still missing. The problem must be for those (like me) with a portable version. Something isn't installing properly.

yes, you just need to update the Photomaker (git pull) and then replace it with NEW Photomager Generation node

zhoobin021 avatar Jan 22 '24 19:01 zhoobin021

Anyone with this problem watch this video cause it helped me solve that problem.

https://www.youtube.com/watch?v=yjCa9WALzAs

Solved my problem, for those using Stability Matrix as your ComfyUI package manager, go to your custom_nodes/ComfyUI-PhotoMaker folder and pip install using

C:\Users[your username]\AppData\Roaming\StabilityMatrix\Packages\ComfyUI\venv\Scripts\pip install -r requirments.txt

prosperinweb avatar Jan 23 '24 08:01 prosperinweb