forked from yondonfu/comfystream
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
stream-packRelated to the ComfyUI Stream Pack custom nodesRelated to the ComfyUI Stream Pack custom nodes
Description
ComfyStream provides it's own opencv build precompiled for nvidia gpu architectures.
When opencv installs into comfystream (docker only), the script removes any existing versions of opencv and replaces the installation with binaries in the PATH.
comfystream/docker/entrypoint.sh
Lines 161 to 200 in ff11b85
| if [ "$1" = "--opencv-cuda" ]; then | |
| cd /workspace/comfystream | |
| conda activate comfystream | |
| # Check if OpenCV CUDA build already exists | |
| if [ ! -f "/workspace/comfystream/opencv-cuda-release.tar.gz" ]; then | |
| # Download and extract OpenCV CUDA build | |
| DOWNLOAD_NAME="opencv-cuda-release.tar.gz" | |
| wget -q -O "$DOWNLOAD_NAME" https://github.com/JJassonn69/ComfyUI-Stream-Pack/releases/download/v2.1/opencv-cuda-release.tar.gz | |
| tar -xzf "$DOWNLOAD_NAME" -C /workspace/comfystream/ | |
| rm "$DOWNLOAD_NAME" | |
| else | |
| echo "OpenCV CUDA build already exists, skipping download." | |
| fi | |
| # Install required libraries | |
| # Remove existing cv2 package | |
| SITE_PACKAGES_DIR="/workspace/miniconda3/envs/comfystream/lib/python3.12/site-packages" | |
| rm -rf "${SITE_PACKAGES_DIR}/cv2"* | |
| # Copy new cv2 package | |
| cp -r /workspace/comfystream/cv2 "${SITE_PACKAGES_DIR}/" | |
| # Handle library dependencies | |
| CONDA_ENV_LIB="/workspace/miniconda3/envs/comfystream/lib" | |
| # Remove existing libstdc++ and copy system one | |
| rm -f "${CONDA_ENV_LIB}/libstdc++.so"* | |
| cp /usr/lib/x86_64-linux-gnu/libstdc++.so* "${CONDA_ENV_LIB}/" | |
| # Copy OpenCV libraries | |
| cp /workspace/comfystream/opencv/build/lib/libopencv_* /usr/lib/x86_64-linux-gnu/ | |
| # remove the opencv-contrib and cv2 folders | |
| rm -rf /workspace/comfystream/opencv_contrib | |
| rm -rf /workspace/comfystream/cv2 | |
| echo "OpenCV CUDA installation completed" | |
| shift | |
| fi |
This is not flexible enough for other applications that require a valid reference to cv2
- ComfyUI-StreamPack needs this package for super resolution
- PyTrickle would benefit from an opencv build with nvidia support
Ideally we can:
- Modify the script so that it installs cv2 (opencv-cuda) using precompiled binaries defined in
pyproject.tomlto remove the docker dependency and support the customized opencv install in other applications - Consider publishing the precompiled wheels to pypip
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
stream-packRelated to the ComfyUI Stream Pack custom nodesRelated to the ComfyUI Stream Pack custom nodes