Skip to content

Custom node dependencies not installed when imported on startup #6035

@TrevorSquillario

Description

@TrevorSquillario

Expected Behavior

Custom nodes should automatically install their python dependencies when imported on startup.

Actual Behavior

Loading custom_nodes from a docker volume. When loading the container I get errors about not having python dependencies installed for the custom nodes.

Steps to Reproduce

Create docker-compose.yaml file mounting the custom_nodes directory to a path on the host. Start the container.

  comfyui-rocm:
    build: 
      context: .
      dockerfile: build/Dockerfile.comfyui.rocm
    container_name: comfyui-rocm
    command: "python main.py --listen 0.0.0.0"
    environment:
      TZ: "Asia/Jakarta"
      ROC_ENABLE_PRE_VEGA: 1
    ports:
      - "8188:8188"
    devices:
      - "/dev/kfd:/dev/kfd"
      - "/dev/dri:/dev/dri"
    group_add:
      - video
    ipc: host
    cap_add:
      - SYS_PTRACE
    security_opt:
      - seccomp:unconfined
    volumes:
      - /data/app/comfyui/custom_nodes:/app/custom_nodes
trevor@ts-ai01:~/git/genai-docker$ ll /data/app/comfyui/custom_nodes/
total 36
drwxrwxr-x  9 trevor trevor 4096 Dec 13 04:12 ./
drwxrwxr-x  3 trevor root   4096 Dec 13 02:51 ../
drwxrwxr-x  7 trevor trevor 4096 Dec 13 04:12 ComfyUI-Advanced-ControlNet/
drwxrwxr-x 11 trevor trevor 4096 Dec 13 04:12 ComfyUI-AnimateDiff-Evolved/
drwxrwxr-x  6 trevor trevor 4096 Dec 13 04:12 ComfyUI-AudioScheduler/
drwxrwxr-x  6 trevor trevor 4096 Dec 13 04:12 ComfyUI_FizzNodes/
drwxrwxr-x 12 trevor trevor 4096 Dec 13 04:12 ComfyUI-Impact-Pack/
drwxrwxr-x 10 trevor trevor 4096 Dec 13 04:12 ComfyUI-VideoHelperSuite/
drwxrwxr-x  8 trevor trevor 4096 Dec 13 04:12 deforum-comfy-nodes/

Debug Logs

Total VRAM 65520 MB, total RAM 192773 MB
pytorch version: 2.6.0.dev20241122+rocm6.2
Set vram state to: NORMAL_VRAM
Device: cuda:0 AMD Instinct MI210 : native
Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
[Prompt Server] web root: /app/web
Starting server

To see the GUI go to: http://0.0.0.0:8188
Total VRAM 65520 MB, total RAM 192773 MB
pytorch version: 2.6.0.dev20241122+rocm6.2
Set vram state to: NORMAL_VRAM
Device: cuda:0 AMD Instinct MI210 : native
Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
[Prompt Server] web root: /app/web
[AnimateDiffEvo] - ERROR - No motion models found. Please download one and place in: ['/app/custom_nodes/ComfyUI-AnimateDiff-Evolved/models', '/app/models/animatediff_models']
Traceback (most recent call last):
  File "/app/nodes.py", line 2035, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/custom_nodes/ComfyUI_FizzNodes/__init__.py", line 57, in <module>
    from .ScheduledNodes import (
  File "/app/custom_nodes/ComfyUI_FizzNodes/ScheduledNodes.py", line 4, in <module>
    import numexpr
ModuleNotFoundError: No module named 'numexpr'

Cannot import /app/custom_nodes/ComfyUI_FizzNodes module for custom nodes: No module named 'numexpr'
Traceback (most recent call last):
  File "/app/nodes.py", line 2035, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/custom_nodes/ComfyUI-AudioScheduler/__init__.py", line 1, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "/app/custom_nodes/ComfyUI-AudioScheduler/nodes.py", line 5, in <module>
    import pandas as pd
ModuleNotFoundError: No module named 'pandas'

Cannot import /app/custom_nodes/ComfyUI-AudioScheduler module for custom nodes: No module named 'pandas'
Traceback (most recent call last):
  File "/app/nodes.py", line 2035, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/custom_nodes/deforum-comfy-nodes/__init__.py", line 1, in <module>
    from .deforum_nodes.mapping import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "/app/custom_nodes/deforum-comfy-nodes/deforum_nodes/mapping.py", line 13, in <module>
    from .nodes.deforum_audiosync_nodes import *
  File "/app/custom_nodes/deforum-comfy-nodes/deforum_nodes/nodes/deforum_audiosync_nodes.py", line 3, in <module>
    import pandas as pd
ModuleNotFoundError: No module named 'pandas'

Cannot import /app/custom_nodes/deforum-comfy-nodes module for custom nodes: No module named 'pandas'
[Impact Pack] Failed to import due to several dependencies are missing!!!!
Traceback (most recent call last):
  File "/app/nodes.py", line 2035, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/custom_nodes/ComfyUI-Impact-Pack/__init__.py", line 47, in <module>
    raise e
  File "/app/custom_nodes/ComfyUI-Impact-Pack/__init__.py", line 29, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'

Cannot import /app/custom_nodes/ComfyUI-Impact-Pack module for custom nodes: No module named 'cv2'
Making the "web\extensions\FizzleDorf" folder
Update to javascripts files detected
Copying Folder here to satisfy init, eventually I'll have stuff in here..txt to extensions folder
### Loading: ComfyUI-Impact-Pack (V8.0.1)
[VideoHelperSuite] - WARNING - Failed to import imageio_ffmpeg
[VideoHelperSuite] - ERROR - No valid ffmpeg found.
Traceback (most recent call last):
  File "/app/nodes.py", line 2035, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/custom_nodes/ComfyUI-VideoHelperSuite/__init__.py", line 1, in <module>
    from .videohelpersuite.nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "/app/custom_nodes/ComfyUI-VideoHelperSuite/videohelpersuite/nodes.py", line 20, in <module>
    from .load_video_nodes import LoadVideoUpload, LoadVideoPath, LoadVideoFFmpegUpload, LoadVideoFFmpegPath, LoadImagePath
  File "/app/custom_nodes/ComfyUI-VideoHelperSuite/videohelpersuite/load_video_nodes.py", line 6, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'

Cannot import /app/custom_nodes/ComfyUI-VideoHelperSuite module for custom nodes: No module named 'cv2'

Import times for custom nodes:
   0.0 seconds (IMPORT FAILED): /app/custom_nodes/ComfyUI-Impact-Pack
   0.0 seconds (IMPORT FAILED): /app/custom_nodes/ComfyUI-AudioScheduler
   0.0 seconds (IMPORT FAILED): /app/custom_nodes/deforum-comfy-nodes
   0.0 seconds (IMPORT FAILED): /app/custom_nodes/ComfyUI_FizzNodes
   0.0 seconds (IMPORT FAILED): /app/custom_nodes/ComfyUI-VideoHelperSuite
   0.0 seconds: /app/custom_nodes/ComfyUI-Advanced-ControlNet
   0.1 seconds: /app/custom_nodes/ComfyUI-AnimateDiff-Evolved

Starting server

To see the GUI go to: http://0.0.0.0:8188

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Potential BugUser is reporting a bug. This should be tested.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions