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

Issue with External Face Model loader since reactor/faces is not a core comfyui folder #67

Open
FawazKadem opened this issue Sep 21, 2024 · 0 comments

Comments

@FawazKadem
Copy link
Contributor

(I made this node and this is my fault)

The External Face Model Lora crashes with a key error. More specifically:

Error occurred when executing ComfyUIDeployExternalFaceModel:

'reactor/faces'

File "/comfyui/execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/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 "/comfyui/execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/comfyui/custom_nodes/comfyui-deploy/comfy-nodes/external_face_model.py", line 71, in run
existing_face_models = folder_paths.get_filename_list("reactor/faces")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/comfyui/folder_paths.py", line 228, in get_filename_list
out = get_filename_list_(folder_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/comfyui/folder_paths.py", line 195, in get_filename_list_
folders = folder_names_and_paths[folder_name]

@BennyKok already submitted a partial fix to this with aea456c

However, there is still an error since the external node tries to call folder_paths.folder_names_and_paths["reactor/faces"]:

if face_model_url and face_model_url.startswith("http"):
          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 issue is that reactor/faces isn't a default core ComfyUI model folder. See https://github.com/comfyanonymous/ComfyUI/blob/364b69e93120b872e78efc2e9626dd23bd232c5c/folder_paths.py#L10-L40

I'm looking into this. Not sure if there is an easy fix. Fixing this issue unlocks a major roadblock in being able to download models that aren't in the limited comfyui core model paths.

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

No branches or pull requests

1 participant