From 96e268a2d44fc714c1a1128e1d367e57cc21378b Mon Sep 17 00:00:00 2001 From: RUFFY-369 Date: Wed, 24 Dec 2025 01:06:53 +0530 Subject: [PATCH 1/6] fix:incorporate #575 PR to solve requirements conflict --- src/comfystream/scripts/constraints.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/comfystream/scripts/constraints.txt b/src/comfystream/scripts/constraints.txt index b36010e6..e240d7ef 100644 --- a/src/comfystream/scripts/constraints.txt +++ b/src/comfystream/scripts/constraints.txt @@ -8,8 +8,8 @@ tensorrt==10.12.0.36 tensorrt-cu12==10.12.0.36 xformers==0.0.32.post2 onnx==1.18.0 -onnxruntime==1.22.0 -onnxruntime-gpu==1.22.0 +onnxruntime>=1.22.0 +onnxruntime-gpu>=1.22.0 onnxmltools==1.14.0 cuda-python<13.0 huggingface-hub>=0.20.0 From 8768deb124a425013ed2f81868063de6ebf00df1 Mon Sep 17 00:00:00 2001 From: RUFFY-369 Date: Wed, 24 Dec 2025 02:48:47 +0530 Subject: [PATCH 2/6] feat:Add build_targets.yaml and dynamic StreamDiffusion engine build logic to entrypoint.sh --- configs/build_targets.yaml | 17 ++++++++++++++++ docker/entrypoint.sh | 41 ++++++++++++++++++++++++++++---------- 2 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 configs/build_targets.yaml diff --git a/configs/build_targets.yaml b/configs/build_targets.yaml new file mode 100644 index 00000000..6836ee95 --- /dev/null +++ b/configs/build_targets.yaml @@ -0,0 +1,17 @@ +# build_targets.yaml +# Maps node names to their build scripts and config files. +# Add new nodes as needed. + +streamdiffusion: + script: /workspace/ComfyUI/custom_nodes/ComfyUI-StreamDiffusion/scripts/build_tensorrt_engines.py + configs: + - /workspace/ComfyUI/custom_nodes/ComfyUI-StreamDiffusion/configs/sd15_singlecontrol.yaml + - /workspace/ComfyUI/custom_nodes/ComfyUI-StreamDiffusion/configs/sdturbo_multicontrol.yaml + folder: /workspace/ComfyUI/custom_nodes/ComfyUI-StreamDiffusion/scripts + +# Example for another node: +# depthanything: +# script: /workspace/ComfyUI/custom_nodes/ComfyUI-DepthAnything/scripts/build_depthanything_engine.py +# configs: +# - /workspace/ComfyUI/custom_nodes/ComfyUI-DepthAnything/configs/depthanything.yaml +# folder: /workspace/ComfyUI/custom_nodes/ComfyUI-DepthAnything/scripts diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index c37e8d76..3e0c12ef 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -138,17 +138,36 @@ if [ "$1" = "--build-engines" ]; then echo "Engines for FasterLivePortrait already exists, skipping..." fi - # Build Engine for StreamDiffusion using trt script and config - ENGINE_SCRIPT="/workspace/ComfyUI/custom_nodes/ComfyUI-StreamDiffusion/scripts/build_tensorrt_engines.py" - CONFIGS=( - "/workspace/ComfyUI/custom_nodes/ComfyUI-StreamDiffusion/configs/sd15_singlecontrol.yaml" - "/workspace/ComfyUI/custom_nodes/ComfyUI-StreamDiffusion/configs/sdturbo_multicontrol.yaml" - ) - cd /workspace/ComfyUI/custom_nodes/ComfyUI-StreamDiffusion/scripts - for ENGINE_CONFIG in "${CONFIGS[@]}"; do - echo "Building StreamDiffusion TensorRT engines using config: $ENGINE_CONFIG" - python "$ENGINE_SCRIPT" --config "$ENGINE_CONFIG" - done + # Build Engine for StreamDiffusion using build_targets.yaml (dynamic, robust) + BUILD_TARGETS_FILE="/workspace/comfystream/configs/build_targets.yaml" + if [ ! -f "$BUILD_TARGETS_FILE" ]; then + echo "build_targets.yaml not found at $BUILD_TARGETS_FILE. Skipping StreamDiffusion engine builds." + else + python3 - <<'EOF' +import os +import yaml + +with open("/workspace/comfystream/configs/build_targets.yaml", "r") as f: + targets = yaml.safe_load(f) + +info = targets.get("streamdiffusion") +if info: + folder = info.get("folder") + script = info.get("script") + configs = info.get("configs", []) + if folder and os.path.isdir(folder) and script and os.path.isfile(script): + for config in configs: + if os.path.isfile(config): + print(f"echo Building streamdiffusion engine with config: {config}") + print(f"python {script} --config {config}") + else: + print(f"echo Warning: Config {config} for streamdiffusion not found, skipping...") + else: + print(f"echo Skipping streamdiffusion: required folder or script not found.") +else: + print("echo streamdiffusion not found in build_targets.yaml, skipping...") +EOF + fi shift fi From b0d6513b5daad91d6b7e0267064dbe6e2ab958c7 Mon Sep 17 00:00:00 2001 From: RUFFY-369 Date: Wed, 24 Dec 2025 20:08:07 +0530 Subject: [PATCH 3/6] fix:compatibility based on https://github.com/yondonfu/comfystream/commit/9f612051350f7615f87fc8502c66336f4d4b2ff3 --- docker/Dockerfile.base | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index d2ce3fbb..c65f849d 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -56,6 +56,9 @@ RUN apt-get remove --purge -y libcudnn9-cuda-12 libcudnn9-dev-cuda-12 || true && # to ensure numpy 2.0 is not installed automatically by another package RUN conda run -n comfystream --no-capture-output pip install "numpy<2.0.0" +# Ensure modelopt pulls a compatible transformers version for HF support +RUN conda run -n comfystream --no-capture-output pip install 'nvidia-modelopt[hf]' + # Install cuDNN 9.8 via conda to match base system version # Caution: Mixed versions installed in environment (system/python) can cause CUDNN_STATUS_SUBLIBRARY_VERSION_MISMATCH errors RUN conda install -n comfystream -y -c nvidia -c conda-forge cudnn=9.8 cuda-version=12.8 From 486a04c5fe4756c7a5bdcd960ff1d12a8e2a9373 Mon Sep 17 00:00:00 2001 From: RUFFY-369 Date: Fri, 26 Dec 2025 18:26:37 +0530 Subject: [PATCH 4/6] fix:streamdiffusion trt build bugs --- docker/entrypoint.sh | 42 ++++++++++++++----------- src/comfystream/scripts/constraints.txt | 7 ++--- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 3e0c12ef..8852d5c8 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -139,33 +139,37 @@ if [ "$1" = "--build-engines" ]; then fi # Build Engine for StreamDiffusion using build_targets.yaml (dynamic, robust) - BUILD_TARGETS_FILE="/workspace/comfystream/configs/build_targets.yaml" - if [ ! -f "$BUILD_TARGETS_FILE" ]; then + BUILD_TARGETS_FILE="/workspace/comfystream/configs/build_targets.yaml" + if [ ! -f "$BUILD_TARGETS_FILE" ]; then echo "build_targets.yaml not found at $BUILD_TARGETS_FILE. Skipping StreamDiffusion engine builds." - else - python3 - <<'EOF' + else + python3 - <<'EOF' import os import yaml +import subprocess with open("/workspace/comfystream/configs/build_targets.yaml", "r") as f: - targets = yaml.safe_load(f) + targets = yaml.safe_load(f) info = targets.get("streamdiffusion") if info: - folder = info.get("folder") - script = info.get("script") - configs = info.get("configs", []) - if folder and os.path.isdir(folder) and script and os.path.isfile(script): - for config in configs: - if os.path.isfile(config): - print(f"echo Building streamdiffusion engine with config: {config}") - print(f"python {script} --config {config}") - else: - print(f"echo Warning: Config {config} for streamdiffusion not found, skipping...") - else: - print(f"echo Skipping streamdiffusion: required folder or script not found.") + folder = info.get("folder") + script = info.get("script") + configs = info.get("configs", []) + if folder and os.path.isdir(folder) and script and os.path.isfile(script): + for config in configs: + if os.path.isfile(config): + print(f"Building streamdiffusion engine with config: {config}") + try: + subprocess.run(["python", script, "--config", config], check=True) + except subprocess.CalledProcessError as e: + print(f"Error building engine for config {config}: {e}") + else: + print(f"Warning: Config {config} for streamdiffusion not found, skipping...") + else: + print(f"Skipping streamdiffusion: required folder or script not found.") else: - print("echo streamdiffusion not found in build_targets.yaml, skipping...") + print("streamdiffusion not found in build_targets.yaml, skipping...") EOF fi shift @@ -237,4 +241,6 @@ if [ "$START_COMFYUI" = true ] || [ "$START_API" = true ] || [ "$START_UI" = tru tail -f /var/log/supervisord.log fi + + exec "$@" diff --git a/src/comfystream/scripts/constraints.txt b/src/comfystream/scripts/constraints.txt index e240d7ef..6e97b134 100644 --- a/src/comfystream/scripts/constraints.txt +++ b/src/comfystream/scripts/constraints.txt @@ -1,12 +1,11 @@ --extra-index-url https://download.pytorch.org/whl/cu128 --extra-index-url https://pypi.nvidia.com numpy<2.0.0 -torch==2.8.0+cu128 -torchvision==0.23.0+cu128 -torchaudio==2.8.0+cu128 +torch==2.7.0+cu128 +torchvision==0.22.0+cu128 +torchaudio==2.7.0+cu128 tensorrt==10.12.0.36 tensorrt-cu12==10.12.0.36 -xformers==0.0.32.post2 onnx==1.18.0 onnxruntime>=1.22.0 onnxruntime-gpu>=1.22.0 From 598afc6c70cf92c1bf13f28b65eadd8976ef92cf Mon Sep 17 00:00:00 2001 From: RUFFY-369 Date: Sat, 27 Dec 2025 01:31:28 +0530 Subject: [PATCH 5/6] fix:normal docker build error --- src/comfystream/scripts/constraints.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/comfystream/scripts/constraints.txt b/src/comfystream/scripts/constraints.txt index 6e97b134..e88d3598 100644 --- a/src/comfystream/scripts/constraints.txt +++ b/src/comfystream/scripts/constraints.txt @@ -12,3 +12,4 @@ onnxruntime-gpu>=1.22.0 onnxmltools==1.14.0 cuda-python<13.0 huggingface-hub>=0.20.0 +mediapipe==0.10.21 From 7e403c98abcee80e3659e862401dff0336b3edfb Mon Sep 17 00:00:00 2001 From: RUFFY-369 Date: Mon, 29 Dec 2025 01:53:34 +0530 Subject: [PATCH 6/6] revert:back torch and xformers to original version --- src/comfystream/scripts/constraints.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/comfystream/scripts/constraints.txt b/src/comfystream/scripts/constraints.txt index e88d3598..54bd7cb6 100644 --- a/src/comfystream/scripts/constraints.txt +++ b/src/comfystream/scripts/constraints.txt @@ -1,11 +1,12 @@ --extra-index-url https://download.pytorch.org/whl/cu128 --extra-index-url https://pypi.nvidia.com numpy<2.0.0 -torch==2.7.0+cu128 -torchvision==0.22.0+cu128 -torchaudio==2.7.0+cu128 +torch==2.8.0+cu128 +torchvision==0.23.0+cu128 +torchaudio==2.8.0+cu128 tensorrt==10.12.0.36 tensorrt-cu12==10.12.0.36 +xformers==0.0.32.post2 onnx==1.18.0 onnxruntime>=1.22.0 onnxruntime-gpu>=1.22.0