Skip to content

Commit d4b997e

Browse files
authored
Merge pull request #265 from livepeer/main
Update the main to the latest with livepeer/comfystream:main
2 parents 3a5b1c3 + 359593a commit d4b997e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1908
-724
lines changed

.github/workflows/docker.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -83,28 +83,6 @@ jobs:
8383
cache-from: type=registry,ref=livepeer/comfyui-base:build-cache
8484
cache-to: type=registry,mode=max,ref=livepeer/comfyui-base:build-cache
8585

86-
trigger:
87-
name: Trigger ai-runner workflow
88-
needs: base
89-
if: ${{ github.repository == 'livepeer/comfystream' }}
90-
runs-on: ubuntu-latest
91-
steps:
92-
- name: Send workflow dispatch event to ai-runner
93-
uses: actions/github-script@v7
94-
with:
95-
github-token: ${{ secrets.CI_GITHUB_TOKEN }}
96-
script: |
97-
await github.rest.actions.createWorkflowDispatch({
98-
owner: context.repo.owner,
99-
repo: "ai-runner",
100-
workflow_id: "comfyui-trigger.yaml",
101-
ref: "main",
102-
inputs: {
103-
"comfyui-base-digest": "${{ needs.base.outputs.image-digest }}",
104-
"triggering-branch": "${{ github.head_ref || github.ref_name }}",
105-
},
106-
});
107-
10886
comfystream:
10987
name: comfystream image
11088
needs: base
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
name: Build OpenCV CUDA Artifact
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
python_version:
7+
description: 'Python version to build'
8+
required: false
9+
default: '3.12'
10+
type: string
11+
cuda_version:
12+
description: 'CUDA version to build'
13+
required: false
14+
default: '12.8'
15+
type: string
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
19+
cancel-in-progress: true
20+
21+
env:
22+
PYTHON_VERSION: ${{ github.event.inputs.python_version || '3.12' }}
23+
CUDA_VERSION: ${{ github.event.inputs.cuda_version || '12.8' }}
24+
25+
jobs:
26+
build-opencv-artifact:
27+
name: Build OpenCV CUDA Artifact
28+
runs-on: [self-hosted, linux, gpu]
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v3
39+
40+
- name: Build OpenCV CUDA Docker image
41+
uses: docker/build-push-action@v6
42+
with:
43+
context: .
44+
file: docker/Dockerfile.opencv
45+
build-args: |
46+
BASE_IMAGE=nvidia/cuda:${{ env.CUDA_VERSION }}.1-cudnn-devel-ubuntu22.04
47+
PYTHON_VERSION=${{ env.PYTHON_VERSION }}
48+
CUDA_VERSION=${{ env.CUDA_VERSION }}
49+
tags: opencv-cuda-artifact:latest
50+
load: true
51+
cache-from: type=gha
52+
cache-to: type=gha,mode=max
53+
54+
- name: Extract OpenCV libraries from Docker container
55+
run: |
56+
echo "Creating temporary container..."
57+
docker create --name opencv-extract opencv-cuda-artifact:latest
58+
59+
echo "Creating workspace directory..."
60+
mkdir -p ./opencv-artifacts
61+
62+
# Try to copy from system installation
63+
docker cp opencv-extract:/usr/local/lib/python${{ env.PYTHON_VERSION }}/site-packages/cv2 ./opencv-artifacts/cv2 || echo "cv2 not found in system site-packages"
64+
65+
echo "Copying OpenCV source directories..."
66+
# Copy opencv and opencv_contrib source directories
67+
docker cp opencv-extract:/workspace/opencv ./opencv-artifacts/ || echo "opencv source not found"
68+
docker cp opencv-extract:/workspace/opencv_contrib ./opencv-artifacts/ || echo "opencv_contrib source not found"
69+
70+
echo "Cleaning up container..."
71+
docker rm opencv-extract
72+
73+
echo "Contents of opencv-artifacts:"
74+
ls -la ./opencv-artifacts/
75+
76+
- name: Create tarball artifact
77+
run: |
78+
echo "Creating opencv-cuda-release.tar.gz..."
79+
cd ./opencv-artifacts
80+
tar -czf ../opencv-cuda-release.tar.gz . || echo "Failed to create tarball"
81+
cd ..
82+
83+
echo "Generating checksums..."
84+
sha256sum opencv-cuda-release.tar.gz > opencv-cuda-release.tar.gz.sha256
85+
md5sum opencv-cuda-release.tar.gz > opencv-cuda-release.tar.gz.md5
86+
87+
echo "Verifying archive contents..."
88+
echo "Archive size: $(ls -lh opencv-cuda-release.tar.gz | awk '{print $5}')"
89+
echo "First 20 files in archive:"
90+
tar -tzf opencv-cuda-release.tar.gz | head -20
91+
92+
- name: Extract and verify tarball
93+
run: |
94+
echo "Testing tarball extraction..."
95+
mkdir -p test-extract
96+
cd test-extract
97+
tar -xzf ../opencv-cuda-release.tar.gz
98+
echo "Extracted contents:"
99+
find . -maxdepth 2 -type d | sort
100+
cd ..
101+
rm -rf test-extract
102+
103+
- name: Upload OpenCV CUDA Release Artifact
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: opencv-cuda-release-python${{ env.PYTHON_VERSION }}-cuda${{ env.CUDA_VERSION }}-${{ github.sha }}
107+
path: |
108+
opencv-cuda-release.tar.gz
109+
opencv-cuda-release.tar.gz.sha256
110+
opencv-cuda-release.tar.gz.md5
111+
retention-days: 30
112+
113+
- name: Create Release Notes
114+
run: |
115+
cat > release-info.txt << EOF
116+
OpenCV CUDA Release Artifact
117+
118+
Build Details:
119+
- Python Version: ${{ env.PYTHON_VERSION }}
120+
- CUDA Version: ${{ env.CUDA_VERSION }}
121+
- OpenCV Version: 4.11.0
122+
- Built on: $(date -u)
123+
- Commit SHA: ${{ github.sha }}
124+
125+
Contents:
126+
- cv2: Python OpenCV module with CUDA support
127+
- opencv: OpenCV source code
128+
- opencv_contrib: OpenCV contrib modules source
129+
- lib: Compiled OpenCV libraries
130+
- include: OpenCV header files
131+
132+
Installation:
133+
1. Download opencv-cuda-release.tar.gz
134+
2. Extract: tar -xzf opencv-cuda-release.tar.gz
135+
3. Copy cv2 to your Python environment's site-packages
136+
4. Ensure CUDA libraries are in your system PATH
137+
138+
Checksums:
139+
SHA256: $(cat opencv-cuda-release.tar.gz.sha256)
140+
MD5: $(cat opencv-cuda-release.tar.gz.md5)
141+
EOF
142+
143+
- name: Upload Release Info
144+
uses: actions/upload-artifact@v4
145+
with:
146+
name: release-info-python${{ env.PYTHON_VERSION }}-cuda${{ env.CUDA_VERSION }}-${{ github.sha }}
147+
path: release-info.txt
148+
retention-days: 30
149+
150+
create-release-draft:
151+
name: Create Release Draft
152+
needs: build-opencv-artifact
153+
runs-on: ubuntu-latest
154+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
155+
156+
steps:
157+
- name: Checkout code
158+
uses: actions/checkout@v4
159+
160+
- name: Download artifacts
161+
uses: actions/download-artifact@v4
162+
with:
163+
name: opencv-cuda-release-python${{ env.PYTHON_VERSION }}-cuda${{ env.CUDA_VERSION }}-${{ github.sha }}
164+
path: ./artifacts
165+
166+
- name: Download release info
167+
uses: actions/download-artifact@v4
168+
with:
169+
name: release-info-python${{ env.PYTHON_VERSION }}-cuda${{ env.CUDA_VERSION }}-${{ github.sha }}
170+
path: ./artifacts
171+
172+
- name: Create Release Draft
173+
uses: softprops/action-gh-release@v1
174+
with:
175+
tag_name: opencv-cuda-v${{ env.PYTHON_VERSION }}-${{ env.CUDA_VERSION }}-${{ github.run_number }}
176+
name: OpenCV CUDA Release - Python ${{ env.PYTHON_VERSION }} CUDA ${{ env.CUDA_VERSION }}
177+
body_path: ./artifacts/release-info.txt
178+
draft: true
179+
files: |
180+
./artifacts/opencv-cuda-release.tar.gz
181+
./artifacts/opencv-cuda-release.tar.gz.sha256
182+
./artifacts/opencv-cuda-release.tar.gz.md5
183+
env:
184+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Checkout code
1515
uses: actions/checkout@v4
1616

17-
- uses: actions/setup-node@v4
17+
- uses: actions/setup-node@v5
1818
with:
1919
node-version: 18
2020
cache: npm

.vscode/launch.json

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,40 @@
3131
"--media-ports=5678",
3232
"--host=0.0.0.0",
3333
"--port=8889",
34-
"--log-level=DEBUG",
34+
"--log-level=INFO",
35+
"--comfyui-inference-log-level=DEBUG",
3536
],
36-
"python": "/workspace/miniconda3/envs/comfystream/bin/python",
37-
"justMyCode": true
37+
"justMyCode": true,
38+
"python": "${command:python.interpreterPath}"
39+
},
40+
{
41+
"name": "Run ComfyStream BYOC",
42+
"type": "debugpy",
43+
"request": "launch",
44+
"cwd": "/workspace/ComfyUI",
45+
"program": "/workspace/comfystream/server/byoc.py",
46+
"console": "integratedTerminal",
47+
"args": [
48+
"--workspace=/workspace/ComfyUI",
49+
"--host=0.0.0.0",
50+
"--port=8000",
51+
"--log-level=INFO",
52+
"--comfyui-inference-log-level=DEBUG",
53+
"--width=512",
54+
"--height=512"
55+
],
56+
"env": {
57+
"ORCH_URL": "https://172.17.0.1:9995",
58+
"ORCH_SECRET": "orch-secret",
59+
"CAPABILITY_NAME": "comfystream",
60+
"CAPABILITY_DESCRIPTION": "ComfyUI streaming processor for BYOC mode",
61+
"CAPABILITY_URL": "http://172.17.0.1:8000",
62+
"CAPABILITY_PRICE_PER_UNIT": "0",
63+
"CAPABILITY_PRICE_SCALING": "1",
64+
"CAPABILITY_CAPACITY": "1"
65+
},
66+
"justMyCode": true,
67+
"python": "${command:python.interpreterPath}"
3868
},
3969
{
4070
"name": "Run ComfyStream UI (Node.js)",

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ This repo also includes a WebRTC server and UI that uses comfystream to support
2929

3030
Refer to [.devcontainer/README.md](.devcontainer/README.md) to setup ComfyStream in a devcontainer using a pre-configured ComfyUI docker environment.
3131

32-
For other installation options, refer to [Install ComfyUI and ComfyStream](https://pipelines.livepeer.org/docs/technical/install/local-testing) in the Livepeer pipelines documentation.
32+
For other installation options, refer to [Install ComfyUI and ComfyStream](https://docs.comfystream.org/technical/get-started/install) in the ComfyStream documentation.
3333

3434
For additional information, refer to the remaining sections below.
3535

3636
### Docker Image
3737

3838
You can quickly deploy ComfyStream using the docker image `livepeer/comfystream`
3939

40-
Refer to the documentation at [https://pipelines.livepeer.org/docs/technical/getting-started/install-comfystream](https://pipelines.livepeer.org/docs/technical/getting-started/install-comfystream) for instructions to run locally or on a remote server.
40+
Refer to the documentation at [https://docs.comfystream.org/technical/get-started/install](https://docs.comfystream.org/technical/get-started/install) for instructions to run locally or on a remote server.
4141

4242
#### RunPod
4343

configs/models.yaml

Lines changed: 80 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ models:
2929
# TAESD models
3030
taesd:
3131
name: "TAESD"
32-
url: "https://raw.githubusercontent.com/madebyollin/taesd/main/taesd_decoder.pth"
33-
path: "vae_approx/taesd_decoder.pth"
32+
url: "https://huggingface.co/madebyollin/taesd/resolve/main/taesd_decoder.safetensors"
33+
path: "vae_approx/taesd_decoder.safetensors"
3434
type: "vae_approx"
3535
extra_files:
36-
- url: "https://raw.githubusercontent.com/madebyollin/taesd/main/taesd_encoder.pth"
37-
path: "vae_approx/taesd_encoder.pth"
36+
- url: "https://huggingface.co/madebyollin/taesd/resolve/main/taesd_encoder.safetensors"
37+
path: "vae_approx/taesd_encoder.safetensors"
3838

3939
# ControlNet models
4040
controlnet-depth:
4141
name: "ControlNet Depth"
4242
url: "https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors"
4343
path: "controlnet/control_v11f1p_sd15_depth_fp16.safetensors"
44-
type: "controlnet"
44+
type: "controlnet"
4545

4646
controlnet-mediapipe-face:
4747
name: "ControlNet MediaPipe Face"
@@ -74,8 +74,82 @@ models:
7474
path: "text_encoders/CLIPText/model.fp16.safetensors"
7575
type: "text_encoder"
7676

77+
# JoyVASA models for ComfyUI-FasterLivePortrait
78+
joyvasa_motion_generator:
79+
name: "JoyVASA Motion Generator"
80+
url: "https://huggingface.co/jdh-algo/JoyVASA/resolve/main/motion_generator/motion_generator_hubert_chinese.pt?download=true"
81+
path: "liveportrait_onnx/joyvasa_models/motion_generator_hubert_chinese.pt"
82+
type: "torch"
83+
84+
joyvasa_audio_model:
85+
name: "JoyVASA Hubert Chinese"
86+
url: "https://huggingface.co/TencentGameMate/chinese-hubert-base/resolve/main/chinese-hubert-base-fairseq-ckpt.pt?download=true"
87+
path: "liveportrait_onnx/joyvasa_models/chinese-hubert-base-fairseq-ckpt.pt"
88+
type: "torch"
89+
90+
joyvasa_motion_template:
91+
name: "JoyVASA Motion Template"
92+
url: "https://huggingface.co/jdh-algo/JoyVASA/resolve/main/motion_template/motion_template.pkl?download=true"
93+
path: "liveportrait_onnx/joyvasa_models/motion_template.pkl"
94+
type: "pickle"
95+
96+
# LivePortrait ONNX models - only necessary to build TRT engines
97+
warping_spade:
98+
name: "WarpingSpadeModel"
99+
url: "https://huggingface.co/warmshao/FasterLivePortrait/resolve/main/liveportrait_onnx/warping_spade-fix.onnx?download=true"
100+
path: "liveportrait_onnx/warping_spade-fix.onnx"
101+
type: "onnx"
102+
103+
motion_extractor:
104+
name: "MotionExtractorModel"
105+
url: "https://huggingface.co/warmshao/FasterLivePortrait/resolve/main/liveportrait_onnx/motion_extractor.onnx?download=true"
106+
path: "liveportrait_onnx/motion_extractor.onnx"
107+
type: "onnx"
108+
109+
landmark:
110+
name: "LandmarkModel"
111+
url: "https://huggingface.co/warmshao/FasterLivePortrait/resolve/main/liveportrait_onnx/landmark.onnx?download=true"
112+
path: "liveportrait_onnx/landmark.onnx"
113+
type: "onnx"
114+
115+
face_analysis_retinaface:
116+
name: "FaceAnalysisModel - RetinaFace"
117+
url: "https://huggingface.co/warmshao/FasterLivePortrait/resolve/main/liveportrait_onnx/retinaface_det_static.onnx?download=true"
118+
path: "liveportrait_onnx/retinaface_det_static.onnx"
119+
type: "onnx"
120+
121+
face_analysis_2dpose:
122+
name: "FaceAnalysisModel - 2DPose"
123+
url: "https://huggingface.co/warmshao/FasterLivePortrait/resolve/main/liveportrait_onnx/face_2dpose_106_static.onnx?download=true"
124+
path: "liveportrait_onnx/face_2dpose_106_static.onnx"
125+
type: "onnx"
126+
127+
appearance_feature_extractor:
128+
name: "AppearanceFeatureExtractorModel"
129+
url: "https://huggingface.co/warmshao/FasterLivePortrait/resolve/main/liveportrait_onnx/appearance_feature_extractor.onnx?download=true"
130+
path: "liveportrait_onnx/appearance_feature_extractor.onnx"
131+
type: "onnx"
132+
133+
stitching:
134+
name: "StitchingModel"
135+
url: "https://huggingface.co/warmshao/FasterLivePortrait/resolve/main/liveportrait_onnx/stitching.onnx?download=true"
136+
path: "liveportrait_onnx/stitching.onnx"
137+
type: "onnx"
138+
139+
stitching_eye_retarget:
140+
name: "StitchingModel (Eye Retargeting)"
141+
url: "https://huggingface.co/warmshao/FasterLivePortrait/resolve/main/liveportrait_onnx/stitching_eye.onnx?download=true"
142+
path: "liveportrait_onnx/stitching_eye.onnx"
143+
type: "onnx"
144+
145+
stitching_lip_retarget:
146+
name: "StitchingModel (Lip Retargeting)"
147+
url: "https://huggingface.co/warmshao/FasterLivePortrait/resolve/main/liveportrait_onnx/stitching_lip.onnx?download=true"
148+
path: "liveportrait_onnx/stitching_lip.onnx"
149+
type: "onnx"
150+
77151
sd-turbo:
78152
name: "SD-Turbo"
79153
url: "https://huggingface.co/stabilityai/sd-turbo/resolve/main/sd_turbo.safetensors"
80154
path: "checkpoints/SD1.5/sd_turbo.safetensors"
81-
type: "checkpoint"
155+
type: "checkpoint"

0 commit comments

Comments
 (0)