adieyal / comfyui-dynamicprompts

ComfyUI custom nodes for Dynamic Prompts
MIT License
187 stars 20 forks source link

Wildcard directory does not work when using custom_nodes folder #54

Open ryanwalder opened 1 week ago

ryanwalder commented 1 week ago

Reproduce:

  1. Create extra_model_paths.yaml file in comfyui base directory (EG: /home/foo/ComfyUI)
  2. Configure custom custom_nodes directory in other_ui config in /home/foo/ComfyUI/extra_model_paths.yaml
    • other_ui:
       base_path: /path/to/custom/directory
       custom_nodes: custom_nodes
  3. Clone this repo into the new custom_nodes directory
    • git clone https://github.com/adieyal/comfyui-dynamicprompts /path/to/custom/directory/custom_nodes/comfyui-dynamicprompts
  4. (Optional) Create some wildcards in /path/to/custom/directory/custom_nodes/comfyui-dynamicprompts/wildcards
  5. Run ComfyUI
  6. Try and use Dynamic Prompts
    • Directory created: /home/foo/ComfyUIc/ustom_nodes/comfyui-dynamicprompts/wildcards
      • Obviously no wildcards in this freshly created directory

The plugin should be reading the wildcards from /path/to/custom/directory/custom_nodes/comfyui-dynamicprompts/wildcards

This then introduces errors during loading because comfyui tries to load the plugin from base_dir/custom_nodes

Traceback (most recent call last):
  File "/home/ryan/git/comfyui/nodes.py", line 1906, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 879, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1016, in get_code
  File "<frozen importlib._bootstrap_external>", line 1073, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/home/ryan/git/comfyui/custom_nodes/comfyui-dynamicprompts/__init__.py'