Skip to content

Commit 3fb5691

Browse files
authored
Merge pull request #211 from livepeer/main
release: sync commits to upstream
2 parents bf67e57 + 22c60af commit 3fb5691

33 files changed

+2926
-251
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"python.defaultInterpreterPath": "/workspace/miniconda3/envs/comfystream/bin/python",
1818
"python.venvPath": "/workspace/miniconda3/envs",
1919
"python.terminal.activateEnvInCurrentTerminal": false,
20-
"python.terminal.activateEnvironment": true,
20+
"python.terminal.activateEnvironment": false,
2121
"terminal.integrated.shellIntegration.enabled": true
2222
},
2323
"extensions": [

.editorconfig

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ charset = utf-8
99
trim_trailing_whitespace = true
1010
insert_final_newline = true
1111

12+
[.gitignore]
13+
insert_final_newline = unset
14+
15+
[*.py]
16+
indent_size = 4
17+
18+
[workflows/comfy*/*.json]
19+
insert_final_newline = unset
20+
1221
[Dockerfile*]
13-
indent_style = tab
14-
indent_size = 8
22+
indent_size = 4
23+
24+
[*.{md,txt,mkdn}]
25+
indent_size = 4
26+
indent_size = unset
27+
trim_trailing_whitespace = false

.github/codeql-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
paths-ignore:
2+
- "docker/"

.github/workflows/comfyui-base.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@ name: Build and push comfyui-base docker image
22

33
on:
44
pull_request:
5-
paths:
6-
- docker/Dockerfile.base
7-
- src/comfystream/scripts/
8-
- configs/
9-
- .github/workflows/comfyui-base.yaml
5+
paths-ignore:
6+
- "ui/*"
107
branches:
118
- main
129
push:
13-
paths:
14-
- docker/Dockerfile.base
15-
- src/comfystream/scripts/
16-
- configs/
17-
- .github/workflows/comfyui-base.yaml
10+
paths-ignore:
11+
- "ui/*"
1812
branches:
1913
- main
2014
tags:

.github/workflows/test.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Test project
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
push:
8+
branches:
9+
- "main"
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
codeql:
17+
name: Perform CodeQL analysis
18+
if: ${{ github.repository == 'livepeer/comfystream' }}
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out code
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
ref: ${{ github.event.pull_request.head.sha }}
26+
27+
# Initializes the CodeQL tools for scanning.
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@v3
30+
with:
31+
languages: typescript,javascript,python
32+
config-file: ./.github/codeql-config.yaml
33+
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@v3
36+
37+
38+
editorconfig:
39+
name: Run editorconfig checker
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Check out code
43+
uses: actions/checkout@v4
44+
with:
45+
# Check https://github.com/livepeer/go-livepeer/pull/1891
46+
# for ref value discussion
47+
ref: ${{ github.event.pull_request.head.sha }}
48+
49+
- name: Install editorconfig-checker
50+
uses: editorconfig-checker/action-editorconfig-checker@main
51+
52+
- name: Run editorconfig checker against the repo
53+
if: false
54+
# disabled editorconfig lint rule for now
55+
run: editorconfig-checker --format github-actions
56+
57+
test:
58+
name: Run Tests
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Check out code
62+
uses: actions/checkout@v4
63+
with:
64+
# Check https://github.com/livepeer/go-livepeer/pull/1891
65+
# for ref value discussion
66+
ref: ${{ github.event.pull_request.head.sha }}
67+
68+
- name: Set up Python
69+
uses: actions/setup-python@v5
70+
with:
71+
python-version: '3.11'
72+
cache: pip
73+
74+
- name: Install dependencies
75+
run: |
76+
python -m pip install --upgrade pip
77+
pip install '.[dev]'
78+
79+
- name: Run tests
80+
run: pytest --cov --verbose --showlocals
81+
82+
- name: Upload coverage to Codecov
83+
uses: codecov/codecov-action@v5
84+
with:
85+
token: ${{ secrets.CI_CODECOV_TOKEN }}
86+
name: ${{ github.event.repository.name }}

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ __pycache__
22
*.egg-info
33
build
44
.DS_STORE
5-
comfyui/
6-
ComfyUI/
5+
./comfyui/
6+
./ComfyUI/
77
cuda_temp
88

99
# VS Code settings
@@ -22,3 +22,6 @@ launch.json
2222
nodes/web/static/*
2323
.cursor/
2424
!nodes/web/static/.gitkeep
25+
26+
# opencv files
27+
opencv

configs/models.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ models:
1616
- url: "https://huggingface.co/aaronb/dreamshaper-8-dmd-1kstep/raw/main/config.json"
1717
path: "unet/dreamshaper-8-dmd-1kstep.json"
1818

19-
# Depth Anything ONNX model
19+
# Depth Anything V2 ONNX models
2020
depthanything-onnx:
2121
name: "DepthAnything ONNX"
2222
url: "https://huggingface.co/yuvraj108c/Depth-Anything-2-Onnx/resolve/main/depth_anything_v2_vitb.onnx?download=true"
2323
path: "tensorrt/depth-anything/depth_anything_vitl14.onnx"
24+
depth-anything-v2-large-onnx:
25+
name: "DepthAnything V2 Large ONNX"
26+
url: "https://huggingface.co/yuvraj108c/Depth-Anything-2-Onnx/resolve/main/depth_anything_v2_vitl.onnx?download=true"
27+
path: "tensorrt/depth-anything/depth_anything_v2_vitl.onnx"
2428

2529
# TAESD models
2630
taesd:
@@ -68,4 +72,4 @@ models:
6872
name: "ClipTextModel"
6973
url: "https://huggingface.co/Lykon/dreamshaper-8/resolve/main/text_encoder/model.fp16.safetensors"
7074
path: "text_encoders/CLIPText/model.fp16.safetensors"
71-
type: "text_encoder"
75+
type: "text_encoder"

configs/nodes.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ nodes:
1111

1212
comfyui-depthanything-tensorrt:
1313
name: "ComfyUI DepthAnything TensorRT"
14-
url: "https://github.com/yuvraj108c/ComfyUI-Depth-Anything-Tensorrt"
14+
url: "https://github.com/rickstaa/ComfyUI-Depth-Anything-Tensorrt"
15+
branch: "feature/add-export-trt-args"
1516
type: "tensorrt"
1617

1718
# Ryan's nodes
@@ -73,5 +74,5 @@ nodes:
7374
comfyui-stream-pack:
7475
name: "ComfyUI Stream Pack"
7576
url: "https://github.com/livepeer/ComfyUI-Stream-Pack"
76-
branch: "expose_feature_bank_to_comfyui"
77-
type: "utility"
77+
branch: "main"
78+
type: "utility"

docker/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ RUN bash -c "source $NVM_DIR/nvm.sh && \
2323
ENV NODE_PATH="$NVM_DIR/v$NODE_VERSION/lib/node_modules" \
2424
PATH="$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH"
2525

26-
RUN conda init bash
2726

2827
# Create the supervisor configuration file for ComfyUI and ComfyStream
2928
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

docker/Dockerfile.base

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,15 @@ RUN mkdir -p /workspace/comfystream && \
2727
wget "https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh" -O /tmp/miniconda.sh && \
2828
bash /tmp/miniconda.sh -b -p /workspace/miniconda3 && \
2929
eval "$(/workspace/miniconda3/bin/conda shell.bash hook)" && \
30-
conda create -n comfystream python="${PYTHON_VERSION}" -y && \
31-
rm /tmp/miniconda.sh && \
32-
conda run -n comfystream --no-capture-output pip install aiortc aiohttp requests tqdm pyyaml --root-user-action=ignore
30+
conda create -n comfystream python="${PYTHON_VERSION}" ffmpeg=6 -c conda-forge -y && \
31+
rm /tmp/miniconda.sh && echo 'export LD_LIBRARY_PATH=/workspace/miniconda3/envs/comfystream/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
3332

3433
# Clone ComfyUI
35-
ADD --link https://github.com/comfyanonymous/ComfyUI.git /workspace/ComfyUI
34+
RUN git clone https://github.com/comfyanonymous/ComfyUI.git /workspace/ComfyUI
3635

3736
# Copy only files needed for setup
38-
COPY --link ./src/comfystream/scripts /workspace/comfystream/src/comfystream/scripts
39-
COPY --link ./configs /workspace/comfystream/configs
40-
41-
# Run setup_nodes (cached unless setup_nodes.py or nodes/ changes)
42-
RUN conda run -n comfystream --no-capture-output --cwd /workspace/comfystream python src/comfystream/scripts/setup_nodes.py --workspace /workspace/ComfyUI
37+
COPY ./src/comfystream/scripts /workspace/comfystream/src/comfystream/scripts
38+
COPY ./configs /workspace/comfystream/configs
4339

4440
# Copy ComfyStream files into ComfyUI
4541
COPY . /workspace/comfystream
@@ -52,14 +48,24 @@ COPY ./test/example-512x512.png /workspace/ComfyUI/input
5248
RUN conda run -n comfystream --no-capture-output --cwd /workspace/ComfyUI pip install -r requirements.txt --root-user-action=ignore
5349

5450
# Install ComfyStream requirements
55-
RUN conda run -n comfystream --no-capture-output --cwd /workspace/comfystream pip install -r requirements.txt --root-user-action=ignore
56-
RUN conda run -n comfystream --no-capture-output --cwd /workspace/comfystream pip install . --root-user-action=ignore
5751
RUN ln -s /workspace/comfystream /workspace/ComfyUI/custom_nodes/comfystream
52+
RUN conda run -n comfystream --no-capture-output --cwd /workspace/comfystream pip install -e . --root-user-action=ignore
5853
RUN conda run -n comfystream --no-capture-output --cwd /workspace/comfystream python install.py --workspace /workspace/ComfyUI
54+
55+
# Run setup_nodes
56+
RUN conda run -n comfystream --no-capture-output --cwd /workspace/comfystream python src/comfystream/scripts/setup_nodes.py --workspace /workspace/ComfyUI
57+
58+
# Install additional dependencies
5959
RUN conda run -n comfystream --no-capture-output pip install --upgrade tensorrt-cu12-bindings tensorrt-cu12-libs --root-user-action=ignore
6060

61+
# Setup opencv with CUDA support
62+
RUN conda run -n comfystream --no-capture-output bash /workspace/comfystream/docker/entrypoint.sh --opencv-cuda
63+
6164
# Configure no environment activation by default
6265
RUN conda config --set auto_activate_base false && \
6366
conda init bash
6467

68+
# Set comfystream environment as default
69+
RUN echo "conda activate comfystream" >> ~/.bashrc
70+
6571
WORKDIR /workspace/comfystream

0 commit comments

Comments
 (0)