Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
10578c4
refactor comfystream to export server and pipeline (#114)
eliteprox Apr 15, 2025
48ffba4
don't use GPU runner for comfyui-base workflow (#133)
pwilczynskiclearcode Apr 16, 2025
f184251
Revert "don't use GPU runner for comfyui-base workflow (#133)" (#134)
pwilczynskiclearcode Apr 16, 2025
fe4d733
exclude app.py from comfystream package (#131)
eliteprox Apr 16, 2025
9bddee0
pin comfyui version to 0.3.27 (#147)
eliteprox Apr 28, 2025
f0f7d7e
update ver to 0.1.0 (#151)
eliteprox Apr 28, 2025
e9b87bc
qualify volume mount with server flag to prevent accident trigger in …
eliteprox Apr 29, 2025
39707aa
workflows: Remove separate build workflows for base and final images …
hjpotter92 May 6, 2025
ed26355
refactor(dev): remove deprecated Tensordock spinup script (#111)
rickstaa May 7, 2025
aba1f1a
[COMFY-77] Update docker.yaml (#181)
hjpotter92 May 7, 2025
ccfa015
docker.yaml: Trigger workflow in ai-runner after comfyui-base is built
hjpotter92 May 8, 2025
20df3e7
fix setup_models when symlink used (#193)
eliteprox May 12, 2025
16f5f31
pinning onnx 1.17.0 due to breaking changes in 1.18.0 related to onnx…
eliteprox May 13, 2025
1259f25
Update README.md (#189)
ad-astra-video May 13, 2025
0ece85d
initial commit for comfystream api
ad-astra-video Feb 6, 2025
465fec4
add GitPython to requirements.txt
ad-astra-video Feb 6, 2025
e42cc31
Add nodes, models and settings api
ad-astra-video Feb 8, 2025
bd42ec5
install nodes in conda environments
ad-astra-video Feb 8, 2025
9d8e95b
fixes for models download and nodes listing
ad-astra-video Feb 13, 2025
020b9d9
reload embedded client
ad-astra-video Feb 13, 2025
1171ae7
update to install in one env
ad-astra-video Mar 12, 2025
678429e
move adding mgmt api routes before route prefix
ad-astra-video Mar 13, 2025
e5d99a6
update reload pipeline
ad-astra-video Mar 13, 2025
0988908
reset webrtc connections on reload
ad-astra-video Mar 14, 2025
98f5a6c
cleanup
ad-astra-video Mar 14, 2025
5d46936
cleanup
ad-astra-video Mar 17, 2025
79b10c6
update routes
ad-astra-video Mar 17, 2025
c0c3a92
update set twilio account info
ad-astra-video Mar 18, 2025
0c5a05c
cleanup
ad-astra-video Mar 18, 2025
1adc535
cleanup
ad-astra-video Mar 18, 2025
4cb6b67
route update and log lines updates
ad-astra-video Mar 18, 2025
5825c82
add enable/disable and restart comfyui
ad-astra-video Mar 29, 2025
04b07fa
add restart comfyui to comfystream menu
ad-astra-video Mar 29, 2025
0ed2303
add mgmt api UI to ComfyStream menu in ComfyUI, some fixes/improvements
ad-astra-video Apr 7, 2025
3fc8196
add mgmt of TURN server credentials
ad-astra-video Apr 14, 2025
7d2a4b1
fix update node
ad-astra-video Apr 18, 2025
d3993eb
add log lines on ComfyUI restart
ad-astra-video Apr 27, 2025
cca6715
fix dependencies and update import
ad-astra-video May 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 0 additions & 76 deletions .github/workflows/comfyui-base.yaml

This file was deleted.

97 changes: 94 additions & 3 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,109 @@ concurrency:
cancel-in-progress: true

jobs:
build:
name: docker builds
base:
name: comfyui-base image
if: ${{ github.repository == 'livepeer/comfystream' }}
outputs:
repository: ${{ steps.repo.outputs.repository }}
image-digest: ${{ steps.build.outputs.digest }}
permissions:
packages: write
contents: read
runs-on: [self-hosted, linux, amd64]
runs-on: [self-hosted, linux, gpu]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Output image repository
id: repo
shell: bash
run: |
echo "repository=livepeer/comfyui-base" >> "$GITHUB_OUTPUT"

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ steps.repo.outputs.repository }}
tags: |
type=sha
type=ref,event=pr
type=ref,event=tag
type=sha,format=long
type=ref,event=branch
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=${{ github.event.pull_request.head.ref }}
type=raw,value=stable,enable=${{ startsWith(github.event.ref, 'refs/tags/v') }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.CI_DOCKERHUB_USERNAME }}
password: ${{ secrets.CI_DOCKERHUB_TOKEN }}

- name: Build and push livepeer docker image
id: build
timeout-minutes: 200
uses: docker/build-push-action@v6
with:
context: .
provenance: mode=max
sbom: true
push: true
tags: ${{ steps.meta.outputs.tags }}
file: docker/Dockerfile.base
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
cache-from: type=registry,ref=livepeer/comfyui-base:build-cache
cache-to: type=registry,mode=max,ref=livepeer/comfyui-base:build-cache

trigger:
name: Trigger ai-runner workflow
needs: base
if: ${{ github.repository == 'livepeer/comfystream' }}
runs-on: ubuntu-latest
steps:
- name: Send workflow dispatch event to ai-runner
uses: actions/github-script@v7
with:
github-token: ${{ secrets.CI_GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: "ai-runner",
workflow_id: "comfyui-trigger.yaml",
ref: "main",
inputs: {
"comfyui-base-digest": "${{ needs.base.outputs.image-digest }}",
"triggering-branch": "${{ github.head_ref || github.ref_name }}",
},
});

comfystream:
name: comfystream image
needs: base
if: ${{ github.repository == 'livepeer/comfystream' }}
permissions:
packages: write
contents: read
runs-on: [self-hosted, linux, amd64]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
Expand All @@ -56,6 +139,12 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.CI_DOCKERHUB_USERNAME }}
password: ${{ secrets.CI_DOCKERHUB_TOKEN }}

- name: Build and push livepeer docker image
uses: docker/build-push-action@v6
with:
Expand All @@ -65,6 +154,8 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
file: docker/Dockerfile
build-args: |
BASE_IMAGE=${{ needs.base.outputs.repository }}@${{ needs.base.outputs.image-digest }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
cache-from: type=registry,ref=${{ github.repository }}:build-cache
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Make sure you have [PyTorch](https://pytorch.org/get-started/locally/) installed
Install `comfystream`:

```bash
pip install git+https://github.com/yondonfu/comfystream.git
pip install git+https://github.com/livepeer/comfystream.git

# This can be used to install from a local repo
# pip install .
Expand Down
2 changes: 1 addition & 1 deletion configs/nodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ nodes:
type: "tensorrt"
dependencies:
- "onnxruntime-gpu>=1.17.0"
- "onnx>=1.17.0"
- "onnx==1.17.0"

comfyui-depthanything-tensorrt:
name: "ComfyUI DepthAnything TensorRT"
Expand Down
5 changes: 1 addition & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ RUN bash -c "source $NVM_DIR/nvm.sh && \
ENV NODE_PATH="$NVM_DIR/v$NODE_VERSION/lib/node_modules" \
PATH="$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH"


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

WORKDIR /workspace/comfystream
COPY --chmod=0755 docker/entrypoint.sh /workspace/comfystream/docker/entrypoint.sh

EXPOSE 8188
EXPOSE 8889
EXPOSE 3000
EXPOSE 8188 8889 3000
EXPOSE 1024-65535/udp

ENTRYPOINT [ "/workspace/comfystream/docker/entrypoint.sh" ]
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN mkdir -p /workspace/comfystream && \
rm /tmp/miniconda.sh && echo 'export LD_LIBRARY_PATH=/workspace/miniconda3/envs/comfystream/lib:$LD_LIBRARY_PATH' >> ~/.bashrc

# Clone ComfyUI
RUN git clone https://github.com/comfyanonymous/ComfyUI.git /workspace/ComfyUI
RUN git clone --branch v0.3.27 --depth 1 https://github.com/comfyanonymous/ComfyUI.git /workspace/ComfyUI

# Copy only files needed for setup
COPY ./src/comfystream/scripts /workspace/comfystream/src/comfystream/scripts
Expand Down
22 changes: 12 additions & 10 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
set -e
eval "$(conda shell.bash hook)"

# Handle workspace mounting
if [ -d "/app" ] && [ ! -d "/app/miniconda3" ]; then
echo "Initializing workspace in /app..."
cp -r /workspace/* /app
fi
if [ "$1" = "--server" ]; then
# Handle workspace mounting
if [ -d "/app" ] && [ ! -d "/app/miniconda3" ]; then
echo "Initializing workspace in /app..."
cp -r /workspace/* /app
fi

if [ -d "/app" ] && [ ! -L "/workspace" ]; then
echo "Starting from volume mount /app..."
cd / && rm -rf /workspace
ln -sf /app /workspace
cd /workspace/comfystream
if [ -d "/app" ] && [ ! -L "/workspace" ]; then
echo "Starting from volume mount /app..."
cd / && rm -rf /workspace
ln -sf /app /workspace
cd /workspace/comfystream
fi
fi

# Add help command to show usage
Expand Down
43 changes: 43 additions & 0 deletions nodes/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import aiohttp
from ..server_manager import LocalComfyStreamServer
from .. import settings_storage
import subprocess

routes = None
server_manager = None
Expand Down Expand Up @@ -215,3 +216,45 @@ async def manage_configuration(request):
logging.error(f"Error managing configuration: {str(e)}")
return web.json_response({"error": str(e)}, status=500)

@routes.post('/comfystream/settings/manage')
async def manage_comfystream(request):
"""Manage ComfyStream server settings"""
#check if server is running
server_status = server_manager.get_status()
if not server_status["running"]:
return web.json_response({"error": "ComfyStream Server is not running"}, status=503)

try:
data = await request.json()
action_type = data.get("action_type")
action = data.get("action")
payload = data.get("payload")
url_host = server_status.get("host", "localhost")
url_port = server_status.get("port", "8889")
mgmt_url = f"http://{url_host}:{url_port}/settings/{action_type}/{action}"

async with aiohttp.ClientSession() as session:
async with session.post(
mgmt_url,
json=payload,
headers={"Content-Type": "application/json"}
) as response:
if not response.ok:
return web.json_response(
{"error": f"Server error: {response.status}"},
status=response.status
)
return web.json_response(await response.json())
except Exception as e:
logging.error(f"Error managing ComfyStream: {str(e)}")
return web.json_response({"error": str(e)}, status=500)

@routes.post('/comfyui/restart')
async def manage_configuration(request):
server_status = server_manager.get_status()
if server_status["running"]:
await server_manager.stop()
logging.info("Restarting ComfyUI...")
subprocess.run(["supervisorctl", "restart", "comfyui"])
logging.info("Restarting ComfyUI...in process")
return web.json_response({"success": True}, status=200)
Loading