Describe the bug
Custom nodes that declare pip dependencies (e.g. comfyui-videohelpersuite, which requires opencv-python and imageio-ffmpeg) never register in ComfyUI when installed via comfy-node-install in a custom Dockerfile built on runpod/worker-comfyui:5.8.6-base. At runtime the worker fails with Node 'VHS Video Combine' not found. The custom node may not be installed. — the underlying cause is ModuleNotFoundError: No module named 'cv2' while ComfyUI imports the node.
Root cause: a venv mismatch.
start.sh launches ComfyUI with python -u /comfyui/main.py → PATH="/opt/venv/bin:${PATH}" makes this resolve to /opt/venv/bin/python.
comfy-cli's resolve_workspace_python() (used by comfy node install / cm_cli) picks VIRTUAL_ENV if set, otherwise /comfyui/.venv (the workspace venv). The base image sets PATH but not VIRTUAL_ENV.
- So
comfy-node-install installs the custom node's pip deps into /comfyui/.venv, which is invisible to the /opt/venv interpreter that actually runs ComfyUI. The node import fails, ComfyUI never registers VHS_VideoCombine, and the workflow errors with missing_node_type.
The base image already solves this for its own deps by mirroring everything into /opt/venv (the DR-1170 comment in the base Dockerfile) via a for r in /comfyui/custom_nodes/*/requirements.txt loop — but that loop runs before user custom nodes are installed, so it does not cover nodes added later by a downstream Dockerfile.
Repro MVP (Minimal Viable Procedure)
FROM runpod/worker-comfyui:5.8.6-base
RUN comfy-node-install comfyui-videohelpersuite video-output-bridge
- Build and deploy this image to a RunPod serverless endpoint.
- Submit any workflow containing a
VHS_VideoCombine node (or any node from a custom node package with pip deps).
- Observe the job fail with:
{"error": {"type": "missing_node_type",
"message": "Node 'VHS Video Combine' not found. The custom node may not be installed."}}
ComfyUI startup log (worker side):
[VideoHelperSuite] - WARNING - Failed to import imageio_ffmpeg
File "/comfyui/custom_nodes/comfyui-videohelpersuite/videohelpersuite/load_video_nodes.py", line 6, in <module>
import cv2
ModuleNotFoundError: No module named 'cv2'
Build log confirms the node installs successfully but deps land in the wrong venv:
Using Python 3.12.3 environment at: /comfyui/.venv
+ opencv-python==5.0.0.93
+ imageio-ffmpeg==0.6.0
1/2 [INSTALLED] comfyui-videohelpersuite [1.7.9]
2/2 [INSTALLED] video-output-bridge [0.2.6]
Expected behavior
comfy-node-install should install a custom node's pip dependencies into the same Python environment ComfyUI runs from (/opt/venv), so the node registers and its classes (VHS_VideoCombine, etc.) appear in /object_info. Alternatively, start.sh should launch ComfyUI from /comfyui/.venv, or the base image should export VIRTUAL_ENV consistently with the launch interpreter.
Workaround (verified)
After comfy-node-install, install the node requirements into the launch venv, mirroring the base image's own dep loop:
FROM runpod/worker-comfyui:5.8.6-base
RUN comfy-node-install comfyui-videohelpersuite video-output-bridge
RUN uv pip install -r /comfyui/requirements.txt \
&& for r in /comfyui/custom_nodes/*/requirements.txt; do \
[ -f "$r" ] && uv pip install -r "$r" || true; \
done \
&& uv pip install "transformers>=4.50.3,<5" "huggingface-hub<1.0"
Screenshots
(Use the two log excerpts above — they are the full evidence. No screenshots available; logs provided instead.)
Versions (please complete the following information):
- Docker version: RunPod serverless build (buildx / OCI export); not a local Docker install
- ComfyUI version: 0.29.0 (from
ARG COMFYUI_VERSION=0.29.0 in the 5.8.6 base image Dockerfile)
- Host OS: Linux (nvidia/cuda:12.8.1-cudnn-runtime-ubuntu24.04), RunPod serverless
- worker-comfyui image:
runpod/worker-comfyui:5.8.6-base
- Custom nodes:
comfyui-videohelpersuite 1.7.9, video-output-bridge 0.2.6 (Comfy Registry)
Additional context
N/A
Describe the bug
Custom nodes that declare pip dependencies (e.g.
comfyui-videohelpersuite, which requiresopencv-pythonandimageio-ffmpeg) never register in ComfyUI when installed viacomfy-node-installin a custom Dockerfile built onrunpod/worker-comfyui:5.8.6-base. At runtime the worker fails withNode 'VHS Video Combine' not found. The custom node may not be installed.— the underlying cause isModuleNotFoundError: No module named 'cv2'while ComfyUI imports the node.Root cause: a venv mismatch.
start.shlaunches ComfyUI withpython -u /comfyui/main.py→PATH="/opt/venv/bin:${PATH}"makes this resolve to/opt/venv/bin/python.comfy-cli'sresolve_workspace_python()(used bycomfy node install/cm_cli) picksVIRTUAL_ENVif set, otherwise/comfyui/.venv(the workspace venv). The base image setsPATHbut notVIRTUAL_ENV.comfy-node-installinstalls the custom node's pip deps into/comfyui/.venv, which is invisible to the/opt/venvinterpreter that actually runs ComfyUI. The node import fails, ComfyUI never registersVHS_VideoCombine, and the workflow errors withmissing_node_type.The base image already solves this for its own deps by mirroring everything into
/opt/venv(the DR-1170 comment in the base Dockerfile) via afor r in /comfyui/custom_nodes/*/requirements.txtloop — but that loop runs before user custom nodes are installed, so it does not cover nodes added later by a downstream Dockerfile.Repro MVP (Minimal Viable Procedure)
VHS_VideoCombinenode (or any node from a custom node package with pip deps).{"error": {"type": "missing_node_type", "message": "Node 'VHS Video Combine' not found. The custom node may not be installed."}}ComfyUI startup log (worker side):
Build log confirms the node installs successfully but deps land in the wrong venv:
Expected behavior
comfy-node-installshould install a custom node's pip dependencies into the same Python environment ComfyUI runs from (/opt/venv), so the node registers and its classes (VHS_VideoCombine, etc.) appear in/object_info. Alternatively,start.shshould launch ComfyUI from/comfyui/.venv, or the base image should exportVIRTUAL_ENVconsistently with the launch interpreter.Workaround (verified)
After
comfy-node-install, install the node requirements into the launch venv, mirroring the base image's own dep loop:Screenshots
(Use the two log excerpts above — they are the full evidence. No screenshots available; logs provided instead.)
Versions (please complete the following information):
ARG COMFYUI_VERSION=0.29.0in the5.8.6base image Dockerfile)runpod/worker-comfyui:5.8.6-basecomfyui-videohelpersuite1.7.9,video-output-bridge0.2.6 (Comfy Registry)Additional context
N/A