Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix refactor face model path config #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ihmily
Copy link
Contributor

@ihmily ihmily commented Nov 26, 2024

Hey bro, The following code maybe has errors https://github.com/BennyKok/comfyui-deploy/blob/aea456cba9f500d6191e09e60f1c70238c5ef939/comfy-nodes/external_face_model.py#L70C13-L83C14

if face_model_save_name:
    existing_face_models = folder_paths.get_filename_list("reactor/faces")
    # Check if face_model_save_name exists in the list
    if face_model_save_name in existing_face_models:
        print(f"using face model: {face_model_save_name}")
        return (face_model_save_name,)
     else:
        face_model_save_name = str(uuid.uuid4()) + ".safetensors"
print(face_model_save_name)
print(folder_paths.folder_names_and_paths["reactor/faces"][0][0])
destination_path = os.path.join(
folder_paths.folder_names_and_paths["reactor/faces"][0][0],
face_model_save_name)

the path reactor/faces is not ComfyUI official path, so the code catch this error

  File "/root/autodl-tmp/ComfyUI/custom_nodes/comfyui-deploy/comfy-nodes/external_face_model.py", line 71, in <module>
    existing_face_models = folder_paths.get_filename_list("reactor/faces")
  File "/root/autodl-tmp/ComfyUI/folder_paths.py", line 228, in get_filename_list
    out = get_filename_list_(folder_name)
  File "/root/autodl-tmp/ComfyUI/folder_paths.py", line 195, in get_filename_list_
    folders = folder_names_and_paths[folder_name]
KeyError: 'reactor/faces'
File "/root/autodl-tmp/ComfyUI/custom_nodes/comfyui-deploy/comfy-nodes/external_face_model.py", line 79, in run
    print(folder_paths.folder_names_and_paths["reactor/faces"][0][0])
KeyError: 'reactor/faces'

related issues:#67

I fix it by register the path to the comfyui folder_paths and load the model list from the model path in advance to default_face_model_name value
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant