ZHO-ZHO-ZHO / ComfyUI-PhotoMaker-ZHO

Unofficial implementation of PhotoMaker for ComfyUI
GNU General Public License v3.0
789 stars 41 forks source link

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

Open zhoobin021 opened 10 months ago

zhoobin021 commented 10 months ago

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.

GraftingRayman commented 10 months ago

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

This will get you your missing nodes

zhoobin021 commented 10 months ago

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.

cvar66 commented 10 months ago

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

prosperinweb commented 10 months ago

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

ceramicwhite commented 10 months ago

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

ponponych commented 10 months ago

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

ceramicwhite commented 10 months ago

@ponponych

Screenshot 2024-01-19 at 9 21 05 PM

You've got something else going on, check your logs.

ponponych commented 10 months ago

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'

ceramicwhite commented 10 months ago

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

ponponych commented 10 months ago

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

prosperinweb commented 10 months ago

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)
leifniem commented 10 months ago

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.

zhoobin021 commented 10 months ago

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

hidogo commented 10 months ago

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 commented 10 months ago

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

Having the same problem

leifniem commented 10 months ago

same problem

Check the comment right above yours

LuisBurdallo commented 10 months ago

#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 commented 10 months ago

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

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

zhoobin021 commented 10 months ago

#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

prosperinweb commented 10 months ago

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