diff --git a/.github/actions/setup-frontend/action.yml b/.github/actions/setup-frontend/action.yml new file mode 100644 index 000000000..2c765bc7d --- /dev/null +++ b/.github/actions/setup-frontend/action.yml @@ -0,0 +1,68 @@ +name: Setup Frontend +description: 'Setup ComfyUI frontend development environment' +inputs: + extra_server_params: + description: 'Additional parameters to pass to ComfyUI server' + required: false + default: '' +runs: + using: 'composite' + steps: + - name: Checkout ComfyUI + uses: actions/checkout@v4 + with: + repository: 'comfyanonymous/ComfyUI' + path: 'ComfyUI' + ref: 'master' + + - 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/ + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + cache: 'pnpm' + cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml' + + - 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: Build & Install ComfyUI_frontend + 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 diff --git a/.github/workflows/i18n-node-defs.yaml b/.github/workflows/i18n-node-defs.yaml index d9105a4ac..71cb417d4 100644 --- a/.github/workflows/i18n-node-defs.yaml +++ b/.github/workflows/i18n-node-defs.yaml @@ -13,7 +13,8 @@ jobs: update-locales: runs-on: ubuntu-latest steps: - - uses: Comfy-Org/ComfyUI_frontend_setup_action@v3 + - name: Setup Frontend + uses: ./.github/actions/setup-frontend - name: Install Playwright Browsers run: pnpm exec playwright install chromium --with-deps working-directory: ComfyUI_frontend diff --git a/.github/workflows/i18n.yaml b/.github/workflows/i18n.yaml index 566a335b5..2871209a1 100644 --- a/.github/workflows/i18n.yaml +++ b/.github/workflows/i18n.yaml @@ -14,7 +14,8 @@ 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: - - uses: Comfy-Org/ComfyUI_frontend_setup_action@v3 + - name: Setup Frontend + uses: ./.github/actions/setup-frontend - name: Cache tool outputs uses: actions/cache@v4 diff --git a/.github/workflows/test-browser-exp.yaml b/.github/workflows/test-browser-exp.yaml index e174e89c3..389385c24 100644 --- a/.github/workflows/test-browser-exp.yaml +++ b/.github/workflows/test-browser-exp.yaml @@ -10,7 +10,8 @@ jobs: runs-on: ubuntu-latest if: github.event.label.name == 'New Browser Test Expectations' steps: - - uses: Comfy-Org/ComfyUI_frontend_setup_action@v3 + - name: Setup Frontend + uses: ./.github/actions/setup-frontend - name: Cache Playwright browsers uses: actions/cache@v4 with: