diff --git a/.github/actions/setup-comfyui-server/action.yml b/.github/actions/setup-comfyui-server/action.yml
new file mode 100644
index 000000000..d1aa1bd57
--- /dev/null
+++ b/.github/actions/setup-comfyui-server/action.yml
@@ -0,0 +1,55 @@
+name: Setup ComfyUI Server
+description: 'Setup ComfyUI server for continuous integration (with ComfyUI_devtools node installed)'
+inputs:
+ extra_server_params:
+ description: 'Additional parameters to pass to ComfyUI server'
+ required: false
+ default: ''
+ launch_server:
+ description: 'Whether to launch the server after setup'
+ required: false
+ default: 'false'
+runs:
+ using: 'composite'
+ steps:
+ # Note: this workflow assume frontend repo is checked out and is built in ../dist
+
+ # Checkout ComfyUI repo, install the dev_tools node and start server
+ - name: Checkout ComfyUI
+ uses: actions/checkout@v5
+ with:
+ repository: 'comfyanonymous/ComfyUI'
+ path: 'ComfyUI'
+
+ - name: Install ComfyUI_devtools from frontend repo
+ shell: bash
+ run: |
+ mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
+ if ! cp -r ./tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/; then
+ echo "::error::Failed to copy ComfyUI_devtools from ./tools/devtools/"
+ echo "::error::This action assumes the ComfyUI_frontend repository is checked out in the current working directory."
+ echo "::error::Please ensure you have run 'actions/checkout@v5' before calling this action."
+ exit 1
+ fi
+
+ - name: Setup Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+
+ - name: Install Python requirements
+ shell: bash
+ working-directory: ComfyUI
+ run: |
+ python -m pip install --upgrade pip
+ pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
+ pip install -r requirements.txt
+ pip install wait-for-it
+
+ - name: Start ComfyUI server
+ if: ${{ inputs.launch_server == 'true' }}
+ shell: bash
+ working-directory: ComfyUI
+ run: |
+ python main.py --cpu --multi-user --front-end-root ../dist ${{ inputs.extra_server_params }} &
+ wait-for-it --service 127.0.0.1:8188 -t 600
diff --git a/.github/actions/setup-frontend/action.yml b/.github/actions/setup-frontend/action.yml
index 3ebc12eb3..6787552ea 100644
--- a/.github/actions/setup-frontend/action.yml
+++ b/.github/actions/setup-frontend/action.yml
@@ -1,31 +1,16 @@
-name: Setup Frontend
-description: 'Setup ComfyUI frontend development environment'
+name: Setup ComfyUI Frontend
+description: 'Install nodejs/pnpm/dependencies and optionally build ComfyUI_frontend'
inputs:
- extra_server_params:
- description: 'Additional parameters to pass to ComfyUI server'
+ include_build_step:
+ description: 'Include the build step to build the frontend. Set to true for workflows that need a built frontend'
required: false
- default: ''
+ default: 'false'
runs:
using: 'composite'
steps:
- - name: Checkout ComfyUI
- uses: actions/checkout@v4
- with:
- repository: 'comfyanonymous/ComfyUI'
- path: 'ComfyUI'
-
- - name: Checkout ComfyUI_frontend
- uses: actions/checkout@v4
- with:
- repository: 'Comfy-Org/ComfyUI_frontend'
- path: 'ComfyUI_frontend'
-
- - name: Copy ComfyUI_devtools from frontend repo
- shell: bash
- run: |
- mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
- cp -r ComfyUI_frontend/tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/
+ # Note: this workflow assume frontend repo is checked out in the root of the workspace
+ # Install pnpm, Node.js, build frontend
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
@@ -36,32 +21,25 @@ runs:
with:
node-version: 'lts/*'
cache: 'pnpm'
- cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
+ cache-dependency-path: './pnpm-lock.yaml'
- - name: Setup Python
- uses: actions/setup-python@v4
+ # Restore tool caches before running any build/lint operations
+ - name: Restore tool output cache
+ uses: actions/cache/restore@v4
with:
- python-version: '3.10'
+ path: |
+ ./.cache
+ ./tsconfig.tsbuildinfo
+ key: tool-cache-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}-${{ hashFiles('./src/**/*.{ts,vue,js,mts}', './*.config.*') }}
+ restore-keys: |
+ tool-cache-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}-
+ tool-cache-${{ runner.os }}-
- - name: Install Python requirements
+ - name: Install dependencies
shell: bash
- working-directory: ComfyUI
- run: |
- python -m pip install --upgrade pip
- pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
- pip install -r requirements.txt
- pip install wait-for-it
+ run: pnpm install --frozen-lockfile
- - name: Build & Install ComfyUI_frontend
+ - name: Build ComfyUI_frontend
+ if: ${{ inputs.include_build_step == 'true' }}
shell: bash
- working-directory: ComfyUI_frontend
- run: |
- pnpm install --frozen-lockfile
- pnpm build
-
- - name: Start ComfyUI server
- shell: bash
- working-directory: ComfyUI
- run: |
- python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist ${{ inputs.extra_server_params }} &
- wait-for-it --service 127.0.0.1:8188 -t 600
\ No newline at end of file
+ run: pnpm build
diff --git a/.github/actions/setup-playwright/action.yml b/.github/actions/setup-playwright/action.yml
index ddd1a7605..89629fb2c 100644
--- a/.github/actions/setup-playwright/action.yml
+++ b/.github/actions/setup-playwright/action.yml
@@ -6,7 +6,6 @@ runs:
- name: Detect Playwright version
id: detect-version
shell: bash
- working-directory: ComfyUI_frontend
run: |
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --json | jq --raw-output '.[0].devDependencies["@playwright/test"].version')
echo "playwright-version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
@@ -22,10 +21,8 @@ runs:
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
shell: bash
run: pnpm exec playwright install chromium --with-deps
- working-directory: ComfyUI_frontend
- name: Install Playwright Browsers (operating system dependencies)
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
shell: bash
run: pnpm exec playwright install-deps
- working-directory: ComfyUI_frontend
\ No newline at end of file
diff --git a/.github/workflows/claude-pr-review.yml b/.github/workflows/claude-pr-review.yml
index 08ad70727..76a9eb0f3 100644
--- a/.github/workflows/claude-pr-review.yml
+++ b/.github/workflows/claude-pr-review.yml
@@ -11,6 +11,10 @@ on:
pull_request:
types: [labeled]
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
wait-for-ci:
runs-on: ubuntu-latest
@@ -73,10 +77,10 @@ jobs:
with:
label_trigger: "claude-review"
prompt: |
- Read the file .claude/commands/comprehensive-pr-review.md and follow ALL the instructions exactly.
-
- CRITICAL: You must post individual inline comments using the gh api commands shown in the file.
- DO NOT create a summary comment.
+ Read the file .claude/commands/comprehensive-pr-review.md and follow ALL the instructions exactly.
+
+ CRITICAL: You must post individual inline comments using the gh api commands shown in the file.
+ DO NOT create a summary comment.
Each issue must be posted as a separate inline comment on the specific line of code.
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
claude_args: "--max-turns 256 --allowedTools 'Bash(git:*),Bash(gh api:*),Bash(gh pr:*),Bash(gh repo:*),Bash(jq:*),Bash(echo:*),Read,Write,Edit,Glob,Grep,WebFetch'"
@@ -86,3 +90,9 @@ jobs:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
REPOSITORY: ${{ github.repository }}
+
+ - name: Remove claude-review label
+ if: always()
+ run: gh pr edit ${{ github.event.pull_request.number }} --remove-label "claude-review"
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/lint-and-format.yaml b/.github/workflows/lint-and-format.yaml
index 1f20ab92e..62956cadb 100644
--- a/.github/workflows/lint-and-format.yaml
+++ b/.github/workflows/lint-and-format.yaml
@@ -4,6 +4,10 @@ on:
pull_request:
branches-ignore: [wip/*, draft/*, temp/*]
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
permissions:
contents: write
pull-requests: write
diff --git a/.github/workflows/tests-ci.yaml b/.github/workflows/tests-ci.yaml
index 1e069ea11..0d33ecf19 100644
--- a/.github/workflows/tests-ci.yaml
+++ b/.github/workflows/tests-ci.yaml
@@ -7,70 +7,37 @@ on:
branches-ignore:
[wip/*, draft/*, temp/*, vue-nodes-migration, sno-playwright-*]
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
setup:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-key.outputs.key }}
steps:
- - name: Checkout ComfyUI
+ - name: Checkout repository
uses: actions/checkout@v5
+
+ # Setup Test Environment, build frontend but do not start server yet
+ - name: Setup ComfyUI server
+ uses: ./.github/actions/setup-comfyui-server
+ - name: Setup frontend
+ uses: ./.github/actions/setup-frontend
with:
- repository: 'comfyanonymous/ComfyUI'
- path: 'ComfyUI'
- ref: master
-
- - name: Checkout ComfyUI_frontend
- uses: actions/checkout@v5
- with:
- repository: 'Comfy-Org/ComfyUI_frontend'
- path: 'ComfyUI_frontend'
-
- - name: Copy ComfyUI_devtools from frontend repo
- run: |
- mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
- cp -r ComfyUI_frontend/tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/
-
- - name: Install pnpm
- uses: pnpm/action-setup@v4
- with:
- version: 10
-
- - uses: actions/setup-node@v4
- with:
- node-version: lts/*
- cache: 'pnpm'
- cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
-
- - name: Cache tool outputs
- uses: actions/cache@v4
- with:
- path: |
- ComfyUI_frontend/.cache
- ComfyUI_frontend/tsconfig.tsbuildinfo
- key: playwright-setup-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}-${{ hashFiles('ComfyUI_frontend/src/**/*.{ts,vue,js}', 'ComfyUI_frontend/*.config.*') }}
- restore-keys: |
- playwright-setup-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}-
- playwright-setup-cache-${{ runner.os }}-
- playwright-tools-cache-${{ runner.os }}-
-
- - name: Build ComfyUI_frontend
- run: |
- pnpm install --frozen-lockfile
- pnpm build
- working-directory: ComfyUI_frontend
+ include_build_step: true
+ - name: Setup Playwright
+ uses: ./.github/actions/setup-playwright # Setup Playwright and cache browsers
+ # Save the entire workspace as cache for later test jobs to restore
- name: Generate cache key
id: cache-key
run: echo "key=$(date +%s)" >> $GITHUB_OUTPUT
-
-
- name: Save cache
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684
with:
- path: |
- ComfyUI
- ComfyUI_frontend
+ path: .
key: comfyui-setup-${{ steps.cache-key.outputs.key }}
# Sharded chromium tests
@@ -85,54 +52,35 @@ jobs:
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
shardTotal: [8]
steps:
+ # download built frontend repo from setup job
- name: Wait for cache propagation
run: sleep 10
-
- name: Restore cached setup
- uses: actions/cache/restore@v4
+ uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684
with:
fail-on-cache-miss: true
- path: |
- ComfyUI
- ComfyUI_frontend
+ path: .
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
- - name: Install pnpm
- uses: pnpm/action-setup@v4
+ # Setup Test Environment for this runner, start server, use cached built frontend ./dist from 'setup' job
+ - name: Setup ComfyUI server
+ uses: ./.github/actions/setup-comfyui-server
with:
- version: 10
-
- - uses: actions/setup-python@v4
- with:
- python-version: '3.10'
- cache: 'pip'
-
- - name: Install requirements
- run: |
- python -m pip install --upgrade pip
- pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
- pip install -r requirements.txt
- pip install wait-for-it
- working-directory: ComfyUI
-
-
+ launch_server: true
+ - name: Setup nodejs, pnpm, reuse built frontend
+ uses: ./.github/actions/setup-frontend
- name: Setup Playwright
- uses: ./ComfyUI_frontend/.github/actions/setup-playwright
-
- - name: Start ComfyUI server
- run: |
- python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist &
- wait-for-it --service 127.0.0.1:8188 -t 600
- working-directory: ComfyUI
+ uses: ./.github/actions/setup-playwright
+ # Run sharded tests and upload sharded reports
- name: Run Playwright tests (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
id: playwright
run: pnpm exec playwright test --project=chromium --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
- working-directory: ComfyUI_frontend
env:
- PLAYWRIGHT_BLOB_OUTPUT_DIR: ../blob-report
+ PLAYWRIGHT_BLOB_OUTPUT_DIR: ./blob-report
- - uses: actions/upload-artifact@v4
+ - name: Upload blob report
+ uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: blob-report-chromium-${{ matrix.shardIndex }}
@@ -151,45 +99,27 @@ jobs:
matrix:
browser: [chromium-2x, chromium-0.5x, mobile-chrome]
steps:
+ # download built frontend repo from setup job
- name: Wait for cache propagation
run: sleep 10
-
- name: Restore cached setup
- uses: actions/cache/restore@v4
+ uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684
with:
fail-on-cache-miss: true
- path: |
- ComfyUI
- ComfyUI_frontend
+ path: .
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
- - name: Install pnpm
- uses: pnpm/action-setup@v4
+ # Setup Test Environment for this runner, start server, use cached built frontend ./dist from 'setup' job
+ - name: Setup ComfyUI server
+ uses: ./.github/actions/setup-comfyui-server
with:
- version: 10
-
- - uses: actions/setup-python@v4
- with:
- python-version: '3.10'
- cache: 'pip'
-
- - name: Install requirements
- run: |
- python -m pip install --upgrade pip
- pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
- pip install -r requirements.txt
- pip install wait-for-it
- working-directory: ComfyUI
-
+ launch_server: true
+ - name: Setup nodejs, pnpm, reuse built frontend
+ uses: ./.github/actions/setup-frontend
- name: Setup Playwright
- uses: ./ComfyUI_frontend/.github/actions/setup-playwright
-
- - name: Start ComfyUI server
- run: |
- python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist &
- wait-for-it --service 127.0.0.1:8188 -t 600
- working-directory: ComfyUI
+ uses: ./.github/actions/setup-playwright
+ # Run tests and upload reports
- name: Run Playwright tests (${{ matrix.browser }})
id: playwright
run: |
@@ -199,13 +129,13 @@ jobs:
--reporter=list \
--reporter=html \
--reporter=json
- working-directory: ComfyUI_frontend
- - uses: actions/upload-artifact@v4
+ - name: Upload Playwright report
+ uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.browser }}
- path: ComfyUI_frontend/playwright-report/
+ path: ./playwright-report/
retention-days: 30
# Merge sharded test reports
@@ -214,32 +144,19 @@ jobs:
runs-on: ubuntu-latest
if: ${{ !cancelled() }}
steps:
- - name: Checkout ComfyUI_frontend
+ - name: Checkout repository
uses: actions/checkout@v5
- with:
- repository: 'Comfy-Org/ComfyUI_frontend'
- path: 'ComfyUI_frontend'
- - name: Install pnpm
- uses: pnpm/action-setup@v4
- with:
- version: 10
-
- - uses: actions/setup-node@v4
- with:
- node-version: lts/*
- cache: 'pnpm'
- cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
-
- - name: Install dependencies
- run: |
- pnpm install --frozen-lockfile
- working-directory: ComfyUI_frontend
+ # Setup Test Environment, we only need playwright to merge reports
+ - name: Setup frontend
+ uses: ./.github/actions/setup-frontend
+ - name: Setup Playwright
+ uses: ./.github/actions/setup-playwright
- name: Download blob reports
uses: actions/download-artifact@v4
with:
- path: ComfyUI_frontend/all-blob-reports
+ path: ./all-blob-reports
pattern: blob-report-chromium-*
merge-multiple: true
@@ -250,13 +167,12 @@ jobs:
# Generate JSON report separately with explicit output path
PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/report.json \
pnpm exec playwright merge-reports --reporter=json ./all-blob-reports
- working-directory: ComfyUI_frontend
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: playwright-report-chromium
- path: ComfyUI_frontend/playwright-report/
+ path: ./playwright-report/
retention-days: 30
#### BEGIN Deployment and commenting (non-forked PRs only)
@@ -272,11 +188,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v5
-
+
- name: Get start time
id: start-time
run: echo "time=$(date -u '+%m/%d/%Y, %I:%M:%S %p')" >> $GITHUB_OUTPUT
-
+
- name: Post starting comment
env:
GITHUB_TOKEN: ${{ github.token }}
@@ -287,7 +203,7 @@ jobs:
"${{ github.head_ref }}" \
"starting" \
"${{ steps.start-time.outputs.time }}"
-
+
# Deploy and comment for non-forked PRs only
deploy-and-comment:
needs: [playwright-tests, merge-reports]
@@ -299,23 +215,20 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v5
-
+
- name: Download all playwright reports
uses: actions/download-artifact@v4
with:
pattern: playwright-report-*
path: reports
-
- - name: Make deployment script executable
- run: chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh
-
+
- name: Deploy reports and comment on PR
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
GITHUB_TOKEN: ${{ github.token }}
run: |
- ./scripts/cicd/pr-playwright-deploy-and-comment.sh \
+ bash ./scripts/cicd/pr-playwright-deploy-and-comment.sh \
"${{ github.event.pull_request.number }}" \
"${{ github.head_ref }}" \
"completed"
diff --git a/.github/workflows/update-locales-for-given-custom-node-repository.yaml b/.github/workflows/update-locales-for-given-custom-node-repository.yaml
index ec085eab5..b9d1b33b9 100644
--- a/.github/workflows/update-locales-for-given-custom-node-repository.yaml
+++ b/.github/workflows/update-locales-for-given-custom-node-repository.yaml
@@ -21,90 +21,64 @@ jobs:
update-locales:
runs-on: ubuntu-latest
steps:
- - name: Checkout ComfyUI
+ - name: Checkout repository
uses: actions/checkout@v5
+
+ # Setup playwright environment with custom node repository
+ - name: Setup ComfyUI Server (without launching)
+ uses: ./.github/actions/setup-comfyui-server
+ - name: Setup frontend
+ uses: ./.github/actions/setup-frontend
with:
- repository: comfyanonymous/ComfyUI
- path: ComfyUI
- ref: master
- - name: Checkout ComfyUI_frontend
- uses: actions/checkout@v5
- with:
- repository: Comfy-Org/ComfyUI_frontend
- path: ComfyUI_frontend
- - name: Copy ComfyUI_devtools from frontend repo
- run: |
- mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
- cp -r ComfyUI_frontend/tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/
+ include_build_step: 'true'
+ - name: Setup Playwright
+ uses: ./.github/actions/setup-playwright
+
+ # Install the custom node repository
- name: Checkout custom node repository
uses: actions/checkout@v5
with:
repository: ${{ inputs.owner }}/${{ inputs.repository }}
path: 'ComfyUI/custom_nodes/${{ inputs.repository }}'
- - name: Install pnpm
- uses: pnpm/action-setup@v4
- with:
- version: 10
- - uses: actions/setup-node@v4
- with:
- node-version: 'lts/*'
- cache: 'pnpm'
- - uses: actions/setup-python@v4
- with:
- python-version: '3.10'
- - name: Install ComfyUI requirements
- run: |
- python -m pip install --upgrade pip
- pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
- pip install -r requirements.txt
- pip install wait-for-it
- working-directory: ComfyUI
- - name: Install custom node requirements
+ - name: Install custom node Python requirements
+ working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
run: |
if [ -f "requirements.txt" ]; then
pip install -r requirements.txt
fi
- working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
- - name: Build & Install ComfyUI_frontend
- run: |
- pnpm install --frozen-lockfile
- pnpm build
- rm -rf ../ComfyUI/web/*
- mv dist/* ../ComfyUI/web/
- working-directory: ComfyUI_frontend
- - name: Start ComfyUI server
- run: |
- python main.py --cpu --multi-user &
- wait-for-it --service 127.0.0.1:8188 -t 600
+
+ # Start ComfyUI Server
+ - name: Start ComfyUI Server
+ shell: bash
working-directory: ComfyUI
- - name: Setup Playwright
- uses: ./ComfyUI_frontend/.github/actions/setup-playwright
+ run: |
+ python main.py --cpu --multi-user --front-end-root ../dist --custom-node-path ../ComfyUI/custom_nodes/${{ inputs.repository }} &
+ wait-for-it --service
+
- name: Start dev server
# Run electron dev server as it is a superset of the web dev server
# We do want electron specific UIs to be translated.
run: pnpm dev:electron &
- working-directory: ComfyUI_frontend
+
- name: Capture base i18n
run: pnpm exec tsx scripts/diff-i18n capture
- working-directory: ComfyUI_frontend
- name: Update en.json
run: pnpm collect-i18n
env:
PLAYWRIGHT_TEST_URL: http://localhost:5173
- working-directory: ComfyUI_frontend
- name: Update translations
run: pnpm locale
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- working-directory: ComfyUI_frontend
- name: Diff base vs updated i18n
run: pnpm exec tsx scripts/diff-i18n diff
- working-directory: ComfyUI_frontend
- name: Update i18n in custom node repository
run: |
LOCALE_DIR=ComfyUI/custom_nodes/${{ inputs.repository }}/locales/
install -d "$LOCALE_DIR"
cp -rf ComfyUI_frontend/temp/diff/* "$LOCALE_DIR"
+
+ # Git ops for pushing changes and creating PR
- name: Check and create fork of custom node repository
run: |
# Try to fork the repository
diff --git a/.github/workflows/update-locales.yaml b/.github/workflows/update-locales.yaml
index 3bf939b23..9ffa702ca 100644
--- a/.github/workflows/update-locales.yaml
+++ b/.github/workflows/update-locales.yaml
@@ -14,35 +14,35 @@ jobs:
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-'))
runs-on: ubuntu-latest
steps:
- - name: Setup Frontend
+ - name: Checkout repository
+ uses: actions/checkout@v5
+
+ # Setup playwright environment
+ - name: Setup ComfyUI Frontend
uses: ./.github/actions/setup-frontend
-
- - name: Cache tool outputs
- uses: actions/cache@v4
with:
- path: |
- ComfyUI_frontend/.cache
- ComfyUI_frontend/.cache
- key: i18n-tools-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}
- restore-keys: |
- i18n-tools-cache-${{ runner.os }}-
+ include_build_step: true
+ - name: Setup ComfyUI Server
+ uses: ./.github/actions/setup-comfyui-server
+ with:
+ launch_server: true
- name: Setup Playwright
uses: ./.github/actions/setup-playwright
+
- name: Start dev server
# Run electron dev server as it is a superset of the web dev server
# We do want electron specific UIs to be translated.
run: pnpm dev:electron &
- working-directory: ComfyUI_frontend
+
+ # Update locales, collect new strings and update translations using OpenAI, then commit changes
- name: Update en.json
run: pnpm collect-i18n
env:
PLAYWRIGHT_TEST_URL: http://localhost:5173
- working-directory: ComfyUI_frontend
- name: Update translations
run: pnpm locale
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- working-directory: ComfyUI_frontend
- name: Commit updated locales
run: |
git config --global user.name 'github-actions'
@@ -56,4 +56,3 @@ jobs:
git add src/locales/
git diff --staged --quiet || git commit -m "Update locales [skip ci]"
git push origin HEAD:${{ github.head_ref }}
- working-directory: ComfyUI_frontend
diff --git a/.github/workflows/update-node-definitions-locales.yaml b/.github/workflows/update-node-definitions-locales.yaml
index b063159dd..ce991d09e 100644
--- a/.github/workflows/update-node-definitions-locales.yaml
+++ b/.github/workflows/update-node-definitions-locales.yaml
@@ -13,24 +13,32 @@ jobs:
update-locales:
runs-on: ubuntu-latest
steps:
- - uses: Comfy-Org/ComfyUI_frontend_setup_action@v3
+ - name: Checkout repository
+ uses: actions/checkout@v5
+ # Setup playwright environment
+ - name: Setup ComfyUI Server (and start)
+ uses: ./.github/actions/setup-comfyui-server
+ with:
+ launch_server: true
+ - name: Setup frontend
+ uses: ./.github/actions/setup-frontend
+ with:
+ include_build_step: true
- name: Setup Playwright
uses: ./.github/actions/setup-playwright
+
- name: Start dev server
# Run electron dev server as it is a superset of the web dev server
# We do want electron specific UIs to be translated.
run: pnpm dev:electron &
- working-directory: ComfyUI_frontend
- name: Update en.json
run: pnpm collect-i18n -- scripts/collect-i18n-node-defs.ts
env:
PLAYWRIGHT_TEST_URL: http://localhost:5173
- working-directory: ComfyUI_frontend
- name: Update translations
run: pnpm locale
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- working-directory: ComfyUI_frontend
- name: Create Pull Request
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
with:
@@ -44,4 +52,3 @@ jobs:
branch: update-locales-node-defs-${{ github.event.inputs.trigger_type }}-${{ github.run_id }}
base: main
labels: dependencies
- path: ComfyUI_frontend
\ No newline at end of file
diff --git a/.github/workflows/update-playwright-expectations.yaml b/.github/workflows/update-playwright-expectations.yaml
index cc0126b7f..61d5051d4 100644
--- a/.github/workflows/update-playwright-expectations.yaml
+++ b/.github/workflows/update-playwright-expectations.yaml
@@ -3,42 +3,106 @@ name: Update Playwright Expectations
on:
pull_request:
- types: [ labeled ]
+ types: [labeled]
+ issue_comment:
+ types: [created]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
- if: github.event.label.name == 'New Browser Test Expectations'
+ if: >
+ ( github.event_name == 'pull_request' && github.event.label.name == 'New Browser Test Expectations' ) ||
+ ( github.event.issue.pull_request &&
+ github.event_name == 'issue_comment' &&
+ (
+ github.event.comment.author_association == 'OWNER' ||
+ github.event.comment.author_association == 'MEMBER' ||
+ github.event.comment.author_association == 'COLLABORATOR'
+ ) &&
+ startsWith(github.event.comment.body, '/update-playwright') )
steps:
- - name: Checkout workflow repo
- uses: actions/checkout@v5
- - name: Setup Frontend
- uses: ./.github/actions/setup-frontend
- - name: Setup Playwright
- uses: ./.github/actions/setup-playwright
- - name: Run Playwright tests and update snapshots
- id: playwright-tests
- run: pnpm exec playwright test --update-snapshots
- continue-on-error: true
- working-directory: ComfyUI_frontend
- - uses: actions/upload-artifact@v4
- if: always()
- with:
- name: playwright-report
- path: ComfyUI_frontend/playwright-report/
- retention-days: 30
- - name: Debugging info
- run: |
- echo "Branch: ${{ github.head_ref }}"
- git status
- working-directory: ComfyUI_frontend
- - name: Commit updated expectations
- run: |
- git config --global user.name 'github-actions'
- git config --global user.email 'github-actions@github.com'
- git fetch origin ${{ github.head_ref }}
- git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
- git add browser_tests
- git commit -m "[automated] Update test expectations"
- git push origin HEAD:${{ github.head_ref }}
- working-directory: ComfyUI_frontend
+ - name: Find Update Comment
+ uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad
+ id: "find-update-comment"
+ with:
+ issue-number: ${{ github.event.number || github.event.issue.number }}
+ comment-author: "github-actions[bot]"
+ body-includes: "Updating Playwright Expectations"
+
+ - name: Add Starting Reaction
+ uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
+ with:
+ comment-id: ${{ steps.find-update-comment.outputs.comment-id }}
+ issue-number: ${{ github.event.number || github.event.issue.number }}
+ body: |
+ Updating Playwright Expectations
+ edit-mode: replace
+ reactions: eyes
+
+ - name: Get Branch SHA
+ id: "get-branch"
+ run: echo ::set-output name=branch::$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')
+ env:
+ REPO: ${{ github.repository }}
+ PR_NO: ${{ github.event.number || github.event.issue.number }}
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Initial Checkout
+ uses: actions/checkout@v5
+ with:
+ ref: ${{ steps.get-branch.outputs.branch }}
+ - name: Setup Frontend
+ uses: ./.github/actions/setup-frontend
+ with:
+ include_build_step: true
+ - name: Setup ComfyUI Server
+ uses: ./.github/actions/setup-comfyui-server
+ with:
+ launch_server: true
+ - name: Setup Playwright
+ uses: ./.github/actions/setup-playwright
+ - name: Run Playwright tests and update snapshots
+ id: playwright-tests
+ run: pnpm exec playwright test --update-snapshots
+ continue-on-error: true
+ - uses: actions/upload-artifact@v4
+ if: always()
+ with:
+ name: playwright-report
+ path: ./playwright-report/
+ retention-days: 30
+ - name: Debugging info
+ run: |
+ echo "PR: ${{ github.event.issue.number }}"
+ echo "Branch: ${{ steps.get-branch.outputs.branch }}"
+ git status
+ - name: Commit updated expectations
+ run: |
+ git config --global user.name 'github-actions'
+ git config --global user.email 'github-actions@github.com'
+ git add browser_tests
+ if git diff --cached --quiet; then
+ echo "No changes to commit"
+ else
+ git commit -m "[automated] Update test expectations"
+ git push origin ${{ steps.get-branch.outputs.branch }}
+ fi
+
+ - name: Add Done Reaction
+ uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
+ if: github.event_name == 'issue_comment'
+ with:
+ comment-id: ${{ steps.find-update-comment.outputs.comment-id }}
+ issue-number: ${{ github.event.number || github.event.issue.number }}
+ reactions: +1
+ reactions-edit-mode: replace
+
+ - name: Remove New Browser Test Expectations label
+ if: always() && github.event_name == 'pull_request'
+ run: gh pr edit ${{ github.event.pull_request.number }} --remove-label "New Browser Test Expectations"
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/vitest-tests.yaml b/.github/workflows/vitest-tests.yaml
index 46155d912..394145188 100644
--- a/.github/workflows/vitest-tests.yaml
+++ b/.github/workflows/vitest-tests.yaml
@@ -6,6 +6,10 @@ on:
pull_request:
branches-ignore: [wip/*, draft/*, temp/*]
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
test:
runs-on: ubuntu-latest
diff --git a/.storybook/README.md b/.storybook/README.md
index 0d34474ec..be5405e51 100644
--- a/.storybook/README.md
+++ b/.storybook/README.md
@@ -211,18 +211,17 @@ This Storybook setup includes:
## Icon Usage in Storybook
-In this project, the `