Comfy-Org/ComfyUI

21 workflows · maturity 50% · 10 patterns · GitHub ↗

Security 2.38/100

Practices

✓ Matrix✓ Permissions○ Security scan○ AI review✓ Cache○ Concurrency✓ Reusable workflows

Detected patterns

Security dimensions

permissions
2.4
security scan
0
supply chain
0
secret handling
0
harden runner
0

Workflows (21)

api-node-template perms .github/workflows/api-node-template.yml
Triggers
pull_request_target
Runs on
ubuntu-latest
Jobs
inject
View raw YAML
name: Append API Node PR template

on:
  pull_request_target:
    types: [opened, reopened, synchronize, ready_for_review]
    paths:
      - 'comfy_api_nodes/**'   # only run if these files changed

permissions:
  contents: read
  pull-requests: write

jobs:
  inject:
    runs-on: ubuntu-latest
    steps:
      - name: Ensure template exists and append to PR body
        uses: actions/github-script@v7
        with:
          script: |
            const { owner, repo } = context.repo;
            const number = context.payload.pull_request.number;
            const templatePath = '.github/PULL_REQUEST_TEMPLATE/api-node.md';
            const marker = '<!-- API_NODE_PR_CHECKLIST: do not remove -->';

            const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number: number });

            let templateText;
            try {
              const res = await github.rest.repos.getContent({
                owner,
                repo,
                path: templatePath,
                ref: pr.base.ref
              });
              const buf = Buffer.from(res.data.content, res.data.encoding || 'base64');
              templateText = buf.toString('utf8');
            } catch (e) {
              core.setFailed(`Required PR template not found at "${templatePath}" on ${pr.base.ref}. Please add it to the repo.`);
              return;
            }

            // Enforce the presence of the marker inside the template (for idempotence)
            if (!templateText.includes(marker)) {
              core.setFailed(`Template at "${templatePath}" does not contain the required marker:\n${marker}\nAdd it so we can detect duplicates safely.`);
              return;
            }

            // If the PR already contains the marker, do not append again.
            const body = pr.body || '';
            if (body.includes(marker)) {
              core.info('Template already present in PR body; nothing to inject.');
              return;
            }

            const newBody = (body ? body + '\n\n' : '') + templateText + '\n';
            await github.rest.pulls.update({ owner, repo, pull_number: number, body: newBody });
            core.notice('API Node template appended to PR description.');
check-ai-co-authors .github/workflows/check-ai-co-authors.yml
Triggers
pull_request
Runs on
ubuntu-latest
Jobs
check-ai-co-authors
Commands
  • bash .github/scripts/check-ai-co-authors.sh "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}"
View raw YAML
name: Check AI Co-Authors

on:
  pull_request:
    branches: ['*']

jobs:
  check-ai-co-authors:
    name: Check for AI agent co-author trailers
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Check commits for AI co-author trailers
        run: bash .github/scripts/check-ai-co-authors.sh "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}"
check-line-endings .github/workflows/check-line-endings.yml
Triggers
pull_request
Runs on
ubuntu-latest
Jobs
check-line-endings
Commands
  • # Get the list of changed files in the PR CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) # Flag to track if CRLF is found CRLF_FOUND=false # Loop through each changed file for FILE in $CHANGED_FILES; do # Check if the file exists and is a text file if [ -f "$FILE" ] && file "$FILE" | grep -q "text"; then # Check for CRLF line endings if grep -UP '\r$' "$FILE"; then echo "Error: Windows line endings (CRLF) detected in $FILE" CRLF_FOUND=true fi fi done # Exit with error if CRLF was found if [ "$CRLF_FOUND" = true ]; then exit 1 fi
View raw YAML
name: Check for Windows Line Endings

on:
  pull_request:
    branches: ['*'] # Trigger on all pull requests to any branch

jobs:
  check-line-endings:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0 # Fetch all history to compare changes

      - name: Check for Windows line endings (CRLF)
        run: |
          # Get the list of changed files in the PR
          CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }})

          # Flag to track if CRLF is found
          CRLF_FOUND=false

          # Loop through each changed file
          for FILE in $CHANGED_FILES; do
            # Check if the file exists and is a text file
            if [ -f "$FILE" ] && file "$FILE" | grep -q "text"; then
              # Check for CRLF line endings
              if grep -UP '\r$' "$FILE"; then
                echo "Error: Windows line endings (CRLF) detected in $FILE"
                CRLF_FOUND=true
              fi
            fi
          done

          # Exit with error if CRLF was found
          if [ "$CRLF_FOUND" = true ]; then
            exit 1
          fi
pullrequest-ci-run matrix .github/workflows/pullrequest-ci-run.yml
Triggers
pull_request_target
Runs on
${{ matrix.runner_label }}, ubuntu-latest
Jobs
pr-test-stable, comment
Matrix
cuda_version, include, include.flags, include.os, include.runner_label, os, python_version, torch_version→ , --use-pytorch-cross-attention, 12.1, 3.10, 3.11, 3.12, 3.9, Linux, Windows, linux, macOS, macos, self-hosted, stable, windows
Actions
comfy-org/comfy-action
View raw YAML
# This is the GitHub Workflow that drives full-GPU-enabled tests of pull requests to ComfyUI, when the 'Run-CI-Test' label is added
# Results are reported as checkmarks on the commits, as well as onto https://ci.comfy.org/
name: Pull Request CI Workflow Runs
on:
    pull_request_target:
        types: [labeled]

jobs:
  pr-test-stable:
    if: ${{ github.event.label.name == 'Run-CI-Test' }}
    strategy:
      fail-fast: false
      matrix:
        os: [macos, linux, windows]
        python_version: ["3.9", "3.10", "3.11", "3.12"]
        cuda_version: ["12.1"]
        torch_version: ["stable"]
        include:
          - os: macos
            runner_label: [self-hosted, macOS]
            flags: "--use-pytorch-cross-attention"
          - os: linux
            runner_label: [self-hosted, Linux]
            flags: ""
          - os: windows
            runner_label: [self-hosted, Windows]
            flags: ""
    runs-on: ${{ matrix.runner_label }}
    steps:
      - name: Test Workflows
        uses: comfy-org/comfy-action@main
        with:
          os: ${{ matrix.os }}
          python_version: ${{ matrix.python_version }}
          torch_version: ${{ matrix.torch_version }}
          google_credentials: ${{ secrets.GCS_SERVICE_ACCOUNT_JSON }}
          comfyui_flags: ${{ matrix.flags }}
          use_prior_commit: 'true'
  comment:
    if: ${{ github.event.label.name == 'Run-CI-Test' }}
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - uses: actions/github-script@v6
        with:
          script: |
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: '(Automated Bot Message) CI Tests are running, you can view the results at https://ci.comfy.org/?branch=${{ github.event.pull_request.number }}%2Fmerge'
            })
release-stable-all .github/workflows/release-stable-all.yml
Triggers
workflow_dispatch
Runs on
Jobs
release_nvidia_default, release_nvidia_cu128, release_nvidia_cu126, release_amd_rocm
View raw YAML
name: "Release Stable All Portable Versions"

on:
  workflow_dispatch:
    inputs:
      git_tag:
        description: 'Git tag'
        required: true
        type: string

jobs:
  release_nvidia_default:
    permissions:
      contents: "write"
      packages: "write"
      pull-requests: "read"
    name: "Release NVIDIA Default (cu130)"
    uses: ./.github/workflows/stable-release.yml
    with:
      git_tag: ${{ inputs.git_tag }}
      cache_tag: "cu130"
      python_minor: "13"
      python_patch: "11"
      rel_name: "nvidia"
      rel_extra_name: ""
      test_release: true
    secrets: inherit

  release_nvidia_cu128:
    permissions:
      contents: "write"
      packages: "write"
      pull-requests: "read"
    name: "Release NVIDIA cu128"
    uses: ./.github/workflows/stable-release.yml
    with:
      git_tag: ${{ inputs.git_tag }}
      cache_tag: "cu128"
      python_minor: "12"
      python_patch: "10"
      rel_name: "nvidia"
      rel_extra_name: "_cu128"
      test_release: true
    secrets: inherit

  release_nvidia_cu126:
    permissions:
      contents: "write"
      packages: "write"
      pull-requests: "read"
    name: "Release NVIDIA cu126"
    uses: ./.github/workflows/stable-release.yml
    with:
      git_tag: ${{ inputs.git_tag }}
      cache_tag: "cu126"
      python_minor: "12"
      python_patch: "10"
      rel_name: "nvidia"
      rel_extra_name: "_cu126"
      test_release: true
    secrets: inherit

  release_amd_rocm:
    permissions:
      contents: "write"
      packages: "write"
      pull-requests: "read"
    name: "Release AMD ROCm 7.2"
    uses: ./.github/workflows/stable-release.yml
    with:
      git_tag: ${{ inputs.git_tag }}
      cache_tag: "rocm72"
      python_minor: "12"
      python_patch: "10"
      rel_name: "amd"
      rel_extra_name: ""
      test_release: false
    secrets: inherit
release-webhook .github/workflows/release-webhook.yml
Triggers
release
Runs on
ubuntu-latest
Jobs
send-webhook
Commands
  • # Generate UUID for delivery ID DELIVERY_ID=$(uuidgen) HOOK_ID="release-webhook-$(date +%s)" # Create webhook payload matching GitHub release webhook format PAYLOAD=$(cat <<EOF { "action": "published", "release": { "id": ${{ github.event.release.id }}, "node_id": "${{ github.event.release.node_id }}", "url": "${{ github.event.release.url }}", "html_url": "${{ github.event.release.html_url }}", "assets_url": "${{ github.event.release.assets_url }}", "upload_url": "${{ github.event.release.upload_url }}", "tag_name": "${{ github.event.release.tag_name }}", "target_commitish": "${{ github.event.release.target_commitish }}", "name": ${{ toJSON(github.event.release.name) }}, "body": ${{ toJSON(github.event.release.body) }}, "draft": ${{ github.event.release.draft }}, "prerelease": ${{ github.event.release.prerelease }}, "created_at": "${{ github.event.release.created_at }}", "published_at": "${{ github.event.release.published_at }}", "author": { "login": "${{ github.event.release.author.login }}", "id": ${{ github.event.release.author.id }}, "node_id": "${{ github.event.release.author.node_id }}", "avatar_url": "${{ github.event.release.author.avatar_url }}", "url": "${{ github.event.release.author.url }}", "html_url": "${{ github.event.release.author.html_url }}", "type": "${{ github.event.release.author.type }}", "site_admin": ${{ github.event.release.author.site_admin }} }, "tarball_url": "${{ github.event.release.tarball_url }}", "zipball_url": "${{ github.event.release.zipball_url }}", "assets": ${{ toJSON(github.event.release.assets) }} }, "repository": { "id": ${{ github.event.repository.id }}, "node_id": "${{ github.event.repository.node_id }}", "name": "${{ github.event.repository.name }}", "full_name": "${{ github.event.repository.full_name }}", "private": ${{ github.event.repository.private }}, "owner": { "login": "${{ github.event.repository.owner.login }}", "id": ${{ github.event.repository.owner.id }}, "node_id": "${{ github.event.repository.owner.node_id }}", "avatar_url": "${{ github.event.repository.owner.avatar_url }}", "url": "${{ github.event.repository.owner.url }}", "html_url": "${{ github.event.repository.owner.html_url }}", "type": "${{ github.event.repository.owner.type }}", "site_admin": ${{ github.event.repository.owner.site_admin }} }, "html_url": "${{ github.event.repository.html_url }}", "clone_url": "${{ github.event.repository.clone_url }}", "git_url": "${{ github.event.repository.git_url }}", "ssh_url": "${{ github.event.repository.ssh_url }}", "url": "${{ github.event.repository.url }}", "created_at": "${{ github.event.repository.created_at }}", "updated_at": "${{ github.event.repository.updated_at }}", "pushed_at": "${{ github.event.repository.pushed_at }}", "default_branch": "${{ github.event.repository.default_branch }}", "fork": ${{ github.event.repository.fork }} }, "sender": { "login": "${{ github.event.sender.login }}", "id": ${{ github.event.sender.id }}, "node_id": "${{ github.event.sender.node_id }}", "avatar_url": "${{ github.event.sender.avatar_url }}", "url": "${{ github.event.sender.url }}", "html_url": "${{ github.event.sender.html_url }}", "type": "${{ github.event.sender.type }}", "site_admin": ${{ github.event.sender.site_admin }} } } EOF ) # Generate HMAC-SHA256 signature SIGNATURE=$(echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" -hex | cut -d' ' -f2) # Send webhook with required headers curl -X POST "$WEBHOOK_URL" \ -H "Content-Type: application/json" \ -H "X-GitHub-Event: release" \ -H "X-GitHub-Delivery: $DELIVERY_ID" \ -H "X-GitHub-Hook-ID: $HOOK_ID" \ -H "X-Hub-Signature-256: sha256=$SIGNATURE" \ -H "User-Agent: GitHub-Actions-Webhook/1.0" \ -d "$PAYLOAD" \ --fail --silent --show-error echo "✅ Release webhook sent successfully"
  • set -euo pipefail if [ -z "${DISPATCH_TOKEN:-}" ]; then echo "::error::DESKTOP_REPO_DISPATCH_TOKEN is required but not set." exit 1 fi PAYLOAD="$(jq -n \ --arg release_tag "$RELEASE_TAG" \ --arg release_url "$RELEASE_URL" \ '{ event_type: "comfyui_release_published", client_payload: { release_tag: $release_tag, release_url: $release_url } }')" curl -fsSL \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${DISPATCH_TOKEN}" \ https://api.github.com/repos/Comfy-Org/desktop/dispatches \ -d "$PAYLOAD" echo "✅ Dispatched ComfyUI release ${RELEASE_TAG} to Comfy-Org/desktop"
View raw YAML
name: Release Webhook

on:
  release:
    types: [published]

jobs:
  send-webhook:
    runs-on: ubuntu-latest
    env:
      DESKTOP_REPO_DISPATCH_TOKEN: ${{ secrets.DESKTOP_REPO_DISPATCH_TOKEN }}
    steps:
      - name: Send release webhook
        env:
          WEBHOOK_URL: ${{ secrets.RELEASE_GITHUB_WEBHOOK_URL }}
          WEBHOOK_SECRET: ${{ secrets.RELEASE_GITHUB_WEBHOOK_SECRET }}
        run: |
          # Generate UUID for delivery ID
          DELIVERY_ID=$(uuidgen)
          HOOK_ID="release-webhook-$(date +%s)"
          
          # Create webhook payload matching GitHub release webhook format
          PAYLOAD=$(cat <<EOF
          {
            "action": "published",
            "release": {
              "id": ${{ github.event.release.id }},
              "node_id": "${{ github.event.release.node_id }}",
              "url": "${{ github.event.release.url }}",
              "html_url": "${{ github.event.release.html_url }}",
              "assets_url": "${{ github.event.release.assets_url }}",
              "upload_url": "${{ github.event.release.upload_url }}",
              "tag_name": "${{ github.event.release.tag_name }}",
              "target_commitish": "${{ github.event.release.target_commitish }}",
              "name": ${{ toJSON(github.event.release.name) }},
              "body": ${{ toJSON(github.event.release.body) }},
              "draft": ${{ github.event.release.draft }},
              "prerelease": ${{ github.event.release.prerelease }},
              "created_at": "${{ github.event.release.created_at }}",
              "published_at": "${{ github.event.release.published_at }}",
              "author": {
                "login": "${{ github.event.release.author.login }}",
                "id": ${{ github.event.release.author.id }},
                "node_id": "${{ github.event.release.author.node_id }}",
                "avatar_url": "${{ github.event.release.author.avatar_url }}",
                "url": "${{ github.event.release.author.url }}",
                "html_url": "${{ github.event.release.author.html_url }}",
                "type": "${{ github.event.release.author.type }}",
                "site_admin": ${{ github.event.release.author.site_admin }}
              },
              "tarball_url": "${{ github.event.release.tarball_url }}",
              "zipball_url": "${{ github.event.release.zipball_url }}",
              "assets": ${{ toJSON(github.event.release.assets) }}
            },
            "repository": {
              "id": ${{ github.event.repository.id }},
              "node_id": "${{ github.event.repository.node_id }}",
              "name": "${{ github.event.repository.name }}",
              "full_name": "${{ github.event.repository.full_name }}",
              "private": ${{ github.event.repository.private }},
              "owner": {
                "login": "${{ github.event.repository.owner.login }}",
                "id": ${{ github.event.repository.owner.id }},
                "node_id": "${{ github.event.repository.owner.node_id }}",
                "avatar_url": "${{ github.event.repository.owner.avatar_url }}",
                "url": "${{ github.event.repository.owner.url }}",
                "html_url": "${{ github.event.repository.owner.html_url }}",
                "type": "${{ github.event.repository.owner.type }}",
                "site_admin": ${{ github.event.repository.owner.site_admin }}
              },
              "html_url": "${{ github.event.repository.html_url }}",
              "clone_url": "${{ github.event.repository.clone_url }}",
              "git_url": "${{ github.event.repository.git_url }}",
              "ssh_url": "${{ github.event.repository.ssh_url }}",
              "url": "${{ github.event.repository.url }}",
              "created_at": "${{ github.event.repository.created_at }}",
              "updated_at": "${{ github.event.repository.updated_at }}",
              "pushed_at": "${{ github.event.repository.pushed_at }}",
              "default_branch": "${{ github.event.repository.default_branch }}",
              "fork": ${{ github.event.repository.fork }}
            },
            "sender": {
              "login": "${{ github.event.sender.login }}",
              "id": ${{ github.event.sender.id }},
              "node_id": "${{ github.event.sender.node_id }}",
              "avatar_url": "${{ github.event.sender.avatar_url }}",
              "url": "${{ github.event.sender.url }}",
              "html_url": "${{ github.event.sender.html_url }}",
              "type": "${{ github.event.sender.type }}",
              "site_admin": ${{ github.event.sender.site_admin }}
            }
          }
          EOF
          )
          
          # Generate HMAC-SHA256 signature
          SIGNATURE=$(echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" -hex | cut -d' ' -f2)
          
          # Send webhook with required headers
          curl -X POST "$WEBHOOK_URL" \
            -H "Content-Type: application/json" \
            -H "X-GitHub-Event: release" \
            -H "X-GitHub-Delivery: $DELIVERY_ID" \
            -H "X-GitHub-Hook-ID: $HOOK_ID" \
            -H "X-Hub-Signature-256: sha256=$SIGNATURE" \
            -H "User-Agent: GitHub-Actions-Webhook/1.0" \
            -d "$PAYLOAD" \
            --fail --silent --show-error
          
          echo "✅ Release webhook sent successfully"

      - name: Send repository dispatch to desktop
        env:
          DISPATCH_TOKEN: ${{ env.DESKTOP_REPO_DISPATCH_TOKEN }}
          RELEASE_TAG: ${{ github.event.release.tag_name }}
          RELEASE_URL: ${{ github.event.release.html_url }}
        run: |
          set -euo pipefail

          if [ -z "${DISPATCH_TOKEN:-}" ]; then
            echo "::error::DESKTOP_REPO_DISPATCH_TOKEN is required but not set."
            exit 1
          fi

          PAYLOAD="$(jq -n \
            --arg release_tag "$RELEASE_TAG" \
            --arg release_url "$RELEASE_URL" \
            '{
              event_type: "comfyui_release_published",
              client_payload: {
                release_tag: $release_tag,
                release_url: $release_url
              }
            }')"

          curl -fsSL \
            -X POST \
            -H "Accept: application/vnd.github+json" \
            -H "Content-Type: application/json" \
            -H "Authorization: Bearer ${DISPATCH_TOKEN}" \
            https://api.github.com/repos/Comfy-Org/desktop/dispatches \
            -d "$PAYLOAD"

          echo "✅ Dispatched ComfyUI release ${RELEASE_TAG} to Comfy-Org/desktop"
ruff .github/workflows/ruff.yml
Triggers
push, pull_request
Runs on
ubuntu-latest, ubuntu-latest
Jobs
ruff, pylint
Commands
  • pip install ruff
  • ruff check .
  • 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 pylint
  • pylint comfy_api_nodes
View raw YAML
name: Python Linting

on: [push, pull_request]

jobs:
  ruff:
    name: Run Ruff
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: 3.x

    - name: Install Ruff
      run: pip install ruff

    - name: Run Ruff
      run: ruff check .

  pylint:
    name: Run Pylint
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: '3.12'

    - 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

    - name: Install Pylint
      run: pip install pylint

    - name: Run Pylint
      run: pylint comfy_api_nodes
stable-release .github/workflows/stable-release.yml
Triggers
workflow_call, workflow_dispatch
Runs on
windows-latest
Jobs
package_comfy_windows
Actions
softprops/action-gh-release
Commands
  • mv ${{ inputs.cache_tag }}_python_deps.tar ../ mv update_comfyui_and_python_dependencies.bat ../ cd .. tar xf ${{ inputs.cache_tag }}_python_deps.tar pwd ls
  • cd .. cp -r ComfyUI ComfyUI_copy curl https://www.python.org/ftp/python/3.${{ inputs.python_minor }}.${{ inputs.python_patch }}/python-3.${{ inputs.python_minor }}.${{ inputs.python_patch }}-embed-amd64.zip -o python_embeded.zip unzip python_embeded.zip -d python_embeded cd python_embeded echo ${{ env.MINOR_VERSION }} echo 'import site' >> ./python3${{ inputs.python_minor }}._pth curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py ./python.exe get-pip.py ./python.exe -s -m pip install ../${{ inputs.cache_tag }}_python_deps/* grep comfy ../ComfyUI/requirements.txt > ./requirements_comfyui.txt ./python.exe -s -m pip install -r requirements_comfyui.txt rm requirements_comfyui.txt sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth if test -f ./Lib/site-packages/torch/lib/dnnl.lib; then rm ./Lib/site-packages/torch/lib/dnnl.lib #I don't think this is actually used and I need the space rm ./Lib/site-packages/torch/lib/libprotoc.lib rm ./Lib/site-packages/torch/lib/libprotobuf.lib fi cd .. git clone --depth 1 https://github.com/comfyanonymous/taesd cp taesd/*.safetensors ./ComfyUI_copy/models/vae_approx/ mkdir ComfyUI_windows_portable mv python_embeded ComfyUI_windows_portable mv ComfyUI_copy ComfyUI_windows_portable/ComfyUI cd ComfyUI_windows_portable mkdir update cp -r ComfyUI/.ci/update_windows/* ./update/ cp -r ComfyUI/.ci/windows_${{ inputs.rel_name }}_base_files/* ./ cp ../update_comfyui_and_python_dependencies.bat ./update/ cd .. "C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=9 -mfb=128 -md=768m -ms=on -mf=BCJ2 ComfyUI_windows_portable.7z ComfyUI_windows_portable mv ComfyUI_windows_portable.7z ComfyUI/ComfyUI_windows_portable_${{ inputs.rel_name }}${{ inputs.rel_extra_name }}.7z
  • cd .. cd ComfyUI_windows_portable python_embeded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu python_embeded/python.exe -s ./update/update.py ComfyUI/ ls
View raw YAML
name: "Release Stable Version"

on:
  workflow_call:
    inputs:
      git_tag:
        description: 'Git tag'
        required: true
        type: string
      cache_tag:
        description: 'Cached dependencies tag'
        required: true
        type: string
        default: "cu129"
      python_minor:
        description: 'Python minor version'
        required: true
        type: string
        default: "13"
      python_patch:
        description: 'Python patch version'
        required: true
        type: string
        default: "6"
      rel_name:
        description: 'Release name'
        required: true
        type: string
        default: "nvidia"
      rel_extra_name:
        description: 'Release extra name'
        required: false
        type: string
        default: ""
      test_release:
        description: 'Test Release'
        required: true
        type: boolean
        default: true
  workflow_dispatch:
    inputs:
      git_tag:
        description: 'Git tag'
        required: true
        type: string
      cache_tag:
        description: 'Cached dependencies tag'
        required: true
        type: string
        default: "cu129"
      python_minor:
        description: 'Python minor version'
        required: true
        type: string
        default: "13"
      python_patch:
        description: 'Python patch version'
        required: true
        type: string
        default: "6"
      rel_name:
        description: 'Release name'
        required: true
        type: string
        default: "nvidia"
      rel_extra_name:
        description: 'Release extra name'
        required: false
        type: string
        default: ""
      test_release:
        description: 'Test Release'
        required: true
        type: boolean
        default: true

jobs:
  package_comfy_windows:
    permissions:
      contents: "write"
      packages: "write"
      pull-requests: "read"
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ inputs.git_tag }}
          fetch-depth: 150
          persist-credentials: false
      - uses: actions/cache/restore@v4
        id: cache
        with:
          path: |
            ${{ inputs.cache_tag }}_python_deps.tar
            update_comfyui_and_python_dependencies.bat
          key: ${{ runner.os }}-build-${{ inputs.cache_tag }}-${{ inputs.python_minor }}
      - shell: bash
        run: |
          mv ${{ inputs.cache_tag }}_python_deps.tar ../
          mv update_comfyui_and_python_dependencies.bat ../
          cd ..
          tar xf ${{ inputs.cache_tag }}_python_deps.tar
          pwd
          ls

      - shell: bash
        run: |
          cd ..
          cp -r ComfyUI ComfyUI_copy
          curl https://www.python.org/ftp/python/3.${{ inputs.python_minor }}.${{ inputs.python_patch }}/python-3.${{ inputs.python_minor }}.${{ inputs.python_patch }}-embed-amd64.zip -o python_embeded.zip
          unzip python_embeded.zip -d python_embeded
          cd python_embeded
          echo ${{ env.MINOR_VERSION }}
          echo 'import site' >> ./python3${{ inputs.python_minor }}._pth
          curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
          ./python.exe get-pip.py
          ./python.exe -s -m pip install ../${{ inputs.cache_tag }}_python_deps/*

          grep comfy ../ComfyUI/requirements.txt > ./requirements_comfyui.txt
          ./python.exe -s -m pip install -r requirements_comfyui.txt
          rm requirements_comfyui.txt

          sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth

          if test -f ./Lib/site-packages/torch/lib/dnnl.lib; then
            rm ./Lib/site-packages/torch/lib/dnnl.lib #I don't think this is actually used and I need the space
            rm ./Lib/site-packages/torch/lib/libprotoc.lib
            rm ./Lib/site-packages/torch/lib/libprotobuf.lib
          fi

          cd ..

          git clone --depth 1 https://github.com/comfyanonymous/taesd
          cp taesd/*.safetensors ./ComfyUI_copy/models/vae_approx/

          mkdir ComfyUI_windows_portable
          mv python_embeded ComfyUI_windows_portable
          mv ComfyUI_copy ComfyUI_windows_portable/ComfyUI

          cd ComfyUI_windows_portable

          mkdir update
          cp -r ComfyUI/.ci/update_windows/* ./update/
          cp -r ComfyUI/.ci/windows_${{ inputs.rel_name }}_base_files/* ./
          cp ../update_comfyui_and_python_dependencies.bat ./update/

          cd ..

          "C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=9 -mfb=128 -md=768m -ms=on -mf=BCJ2 ComfyUI_windows_portable.7z ComfyUI_windows_portable
          mv ComfyUI_windows_portable.7z ComfyUI/ComfyUI_windows_portable_${{ inputs.rel_name }}${{ inputs.rel_extra_name }}.7z

      - shell: bash
        if: ${{ inputs.test_release }}
        run: |
          cd ..
          cd ComfyUI_windows_portable
          python_embeded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu

          python_embeded/python.exe -s ./update/update.py ComfyUI/

          ls

      - name: Upload binaries to release
        uses: softprops/action-gh-release@v2
        with:
          files: ComfyUI_windows_portable_${{ inputs.rel_name }}${{ inputs.rel_extra_name }}.7z
          tag_name: ${{ inputs.git_tag }}
          draft: true
          overwrite_files: true
stale-issues perms .github/workflows/stale-issues.yml
Triggers
schedule
Runs on
ubuntu-latest
Jobs
stale
Actions
actions/stale
View raw YAML
name: 'Close stale issues'
on:
  schedule:
    # Run daily at 430 am PT
    - cron: '30 11 * * *'
permissions:
  issues: write

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v9
        with:
          stale-issue-message: "This issue is being marked stale because it has not had any activity for 30 days. Reply below within 7 days if your issue still isn't solved, and it will be left open. Otherwise, the issue will be closed automatically."
          days-before-stale: 30
          days-before-close: 7
          stale-issue-label: 'Stale'
          only-labels: 'User Support'
          exempt-all-assignees: true
          exempt-all-milestones: true
test-build matrix .github/workflows/test-build.yml
Triggers
push
Runs on
ubuntu-latest
Jobs
build
Matrix
python-version→ 3.10, 3.11, 3.12, 3.13, 3.14
Commands
  • python -m pip install --upgrade pip pip install -r requirements.txt
View raw YAML
name: Build package

#
# This workflow is a test of the python package build.
# Install Python dependencies across different Python versions.
#

on:
  push:
    paths:
      - "requirements.txt"
      - ".github/workflows/test-build.yml"

jobs:
  build:
    name: Build Test
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
    steps:
      - uses: actions/checkout@v4
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt
test-ci matrix .github/workflows/test-ci.yml
Triggers
push, workflow_dispatch
Runs on
${{ matrix.runner_label }}, ${{ matrix.runner_label }}
Jobs
test-stable, test-unix-nightly
Matrix
cuda_version, include, include.flags, include.os, include.runner_label, os, python_version, torch_version→ , 12.1, 3.10, 3.11, 3.12, Linux, linux, nightly, self-hosted, stable
Actions
comfy-org/comfy-action, comfy-org/comfy-action
View raw YAML
# This is the GitHub Workflow that drives automatic full-GPU-enabled tests of all new commits to the master branch of ComfyUI
# Results are reported as checkmarks on the commits, as well as onto https://ci.comfy.org/
name: Full Comfy CI Workflow Runs
on:
  push:
    branches:
      - master
      - release/**
    paths-ignore:
      - 'app/**'
      - 'input/**'
      - 'output/**'
      - 'notebooks/**'
      - 'script_examples/**'
      - '.github/**'
      - 'web/**'
  workflow_dispatch:

jobs:
  test-stable:
    strategy:
      fail-fast: false
      matrix:
        # os: [macos, linux, windows]
        # os: [macos, linux]
        os: [linux]
        python_version: ["3.10", "3.11", "3.12"]
        cuda_version: ["12.1"]
        torch_version: ["stable"]
        include:
          # - os: macos
          #   runner_label: [self-hosted, macOS]
          #   flags: "--use-pytorch-cross-attention"
          - os: linux
            runner_label: [self-hosted, Linux]
            flags: ""
          # - os: windows
          #   runner_label: [self-hosted, Windows]
          #   flags: ""
    runs-on: ${{ matrix.runner_label }}
    steps:
      - name: Test Workflows
        uses: comfy-org/comfy-action@main
        with:
          os: ${{ matrix.os }}
          python_version: ${{ matrix.python_version }}
          torch_version: ${{ matrix.torch_version }}
          google_credentials: ${{ secrets.GCS_SERVICE_ACCOUNT_JSON }}
          comfyui_flags: ${{ matrix.flags }}

  # test-win-nightly:
  #   strategy:
  #     fail-fast: true
  #     matrix:
  #       os: [windows]
  #       python_version: ["3.9", "3.10", "3.11", "3.12"]
  #       cuda_version: ["12.1"]
  #       torch_version: ["nightly"]
  #       include:
  #         - os: windows
  #           runner_label: [self-hosted, Windows]
  #           flags: ""
  #   runs-on: ${{ matrix.runner_label }}
  #   steps:
  #     - name: Test Workflows
  #       uses: comfy-org/comfy-action@main
  #       with:
  #         os: ${{ matrix.os }}
  #         python_version: ${{ matrix.python_version }}
  #         torch_version: ${{ matrix.torch_version }}
  #         google_credentials: ${{ secrets.GCS_SERVICE_ACCOUNT_JSON }}
  #         comfyui_flags: ${{ matrix.flags }}

  test-unix-nightly:
    strategy:
      fail-fast: false
      matrix:
        # os: [macos, linux]
        os: [linux]
        python_version: ["3.11"]
        cuda_version: ["12.1"]
        torch_version: ["nightly"]
        include:
          # - os: macos
          #   runner_label: [self-hosted, macOS]
          #   flags: "--use-pytorch-cross-attention"
          - os: linux
            runner_label: [self-hosted, Linux]
            flags: ""
    runs-on: ${{ matrix.runner_label }}
    steps:
      - name: Test Workflows
        uses: comfy-org/comfy-action@main
        with:
          os: ${{ matrix.os }}
          python_version: ${{ matrix.python_version }}
          torch_version: ${{ matrix.torch_version }}
          google_credentials: ${{ secrets.GCS_SERVICE_ACCOUNT_JSON }}
          comfyui_flags: ${{ matrix.flags }}
test-execution matrix .github/workflows/test-execution.yml
Triggers
push, pull_request
Runs on
${{ matrix.os }}
Jobs
test
Matrix
os→ macos-latest, ubuntu-latest, windows-latest
Commands
  • 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 -r tests-unit/requirements.txt
  • python -m pytest tests/execution -v --skip-timing-checks
View raw YAML
name: Execution Tests

on:
  push:
    branches: [ main, master, release/** ]
  pull_request:
    branches: [ main, master, release/** ]

jobs:
  test:
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
    runs-on: ${{ matrix.os }}
    continue-on-error: true
    steps:
    - uses: actions/checkout@v4
    - name: Set up Python      
      uses: actions/setup-python@v4
      with:
        python-version: '3.12'
    - 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 -r tests-unit/requirements.txt
    - name: Run Execution Tests
      run: |
        python -m pytest tests/execution -v --skip-timing-checks
test-launch .github/workflows/test-launch.yml
Triggers
push, pull_request
Runs on
ubuntu-latest
Jobs
test
Commands
  • 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
  • python main.py --cpu 2>&1 | tee console_output.log & wait-for-it --service 127.0.0.1:8188 -t 30
  • grep -v "Found comfy_kitchen backend triton: {'available': False, 'disabled': True, 'unavailable_reason': \"ImportError: No module named 'triton'\", 'capabilities': \[\]}" console_output.log | grep -v "Found comfy_kitchen backend triton: {'available': False, 'disabled': False, 'unavailable_reason': \"ImportError: No module named 'triton'\", 'capabilities': \[\]}" > console_output_filtered.log cat console_output_filtered.log if grep -qE "Exception|Error" console_output_filtered.log; then echo "Unhandled exception/error found in server log." exit 1 fi
View raw YAML
name: Test server launches without errors

on:
  push:
    branches: [ main, master, release/** ]
  pull_request:
    branches: [ main, master, release/** ]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout ComfyUI
      uses: actions/checkout@v4
      with:
        repository: "Comfy-Org/ComfyUI"
        path: "ComfyUI"
    - uses: actions/setup-python@v4
      with:
        python-version: '3.10'
    - 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
    - name: Start ComfyUI server
      run: |
        python main.py --cpu 2>&1 | tee console_output.log &
        wait-for-it --service 127.0.0.1:8188 -t 30
      working-directory: ComfyUI
    - name: Check for unhandled exceptions in server log
      run: |
        grep -v "Found comfy_kitchen backend triton: {'available': False, 'disabled': True, 'unavailable_reason': \"ImportError: No module named 'triton'\", 'capabilities': \[\]}" console_output.log | grep -v "Found comfy_kitchen backend triton: {'available': False, 'disabled': False, 'unavailable_reason': \"ImportError: No module named 'triton'\", 'capabilities': \[\]}" > console_output_filtered.log
        cat console_output_filtered.log
        if grep -qE "Exception|Error" console_output_filtered.log; then
          echo "Unhandled exception/error found in server log."
          exit 1
        fi
      working-directory: ComfyUI
    - uses: actions/upload-artifact@v4
      if: always()
      with:
        name: console-output
        path: ComfyUI/console_output.log
        retention-days: 30
test-unit matrix .github/workflows/test-unit.yml
Triggers
push, pull_request
Runs on
${{ matrix.os }}
Jobs
test
Matrix
os→ macos-latest, ubuntu-latest, windows-2022
Commands
  • 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 -r tests-unit/requirements.txt python -m pytest tests-unit
View raw YAML
name: Unit Tests

on:
  push:
    branches: [ main, master, release/** ]
  pull_request:
    branches: [ main, master, release/** ]

jobs:
  test:
    strategy:
      matrix:
        os: [ubuntu-latest, windows-2022, macos-latest]
    runs-on: ${{ matrix.os }}
    continue-on-error: true
    steps:
    - uses: actions/checkout@v4
    - name: Set up Python      
      uses: actions/setup-python@v4
      with:
        python-version: '3.12'
    - 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
    - name: Run Unit Tests
      run: |
        pip install -r tests-unit/requirements.txt
        python -m pytest tests-unit
update-api-stubs .github/workflows/update-api-stubs.yml
Triggers
schedule, workflow_dispatch
Runs on
ubuntu-latest
Jobs
generate-models
Actions
peter-evans/create-pull-request
Commands
  • python -m pip install --upgrade pip pip install 'datamodel-code-generator[http]' npm install @redocly/cli
  • curl -o openapi.yaml https://api.comfy.org/openapi
  • npx @redocly/cli bundle openapi.yaml --output filtered-openapi.yaml --config comfy_api_nodes/redocly.yaml --remove-unused-components
  • datamodel-codegen --use-subclass-enum --input filtered-openapi.yaml --output comfy_api_nodes/apis --output-model-type pydantic_v2.BaseModel
  • git diff --exit-code comfy_api_nodes/apis || echo "changes=true" >> $GITHUB_OUTPUT
View raw YAML
name: Generate Pydantic Stubs from api.comfy.org

on:
  schedule:
    - cron: '0 0 * * 1'
  workflow_dispatch:

jobs:
  generate-models:
    runs-on: ubuntu-latest
    
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
      
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.10'
      
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install 'datamodel-code-generator[http]'
          npm install @redocly/cli
      
      - name: Download OpenAPI spec
        run: |
          curl -o openapi.yaml https://api.comfy.org/openapi
      
      - name: Filter OpenAPI spec with Redocly
        run: |
          npx @redocly/cli bundle openapi.yaml --output filtered-openapi.yaml --config comfy_api_nodes/redocly.yaml --remove-unused-components
      
      - name: Generate API models
        run: |
          datamodel-codegen --use-subclass-enum --input filtered-openapi.yaml --output comfy_api_nodes/apis --output-model-type pydantic_v2.BaseModel
      
      - name: Check for changes
        id: git-check
        run: |
          git diff --exit-code comfy_api_nodes/apis || echo "changes=true" >> $GITHUB_OUTPUT
      
      - name: Create Pull Request
        if: steps.git-check.outputs.changes == 'true'
        uses: peter-evans/create-pull-request@v5
        with:
          commit-message: 'chore: update API models from OpenAPI spec'
          title: 'Update API models from api.comfy.org'
          body: |
            This PR updates the API models based on the latest api.comfy.org OpenAPI specification.
            
            Generated automatically by the a Github workflow.
          branch: update-api-stubs
          delete-branch: true
          base: master
update-ci-container .github/workflows/update-ci-container.yml
Triggers
release, workflow_dispatch
Runs on
ubuntu-latest
Jobs
update-ci-container
Actions
peter-evans/create-pull-request
Commands
  • if [ "${{ github.event_name }}" = "release" ]; then VERSION="${{ github.event.release.tag_name }}" else VERSION="${{ inputs.version }}" fi echo "version=$VERSION" >> $GITHUB_OUTPUT
  • CURRENT=$(grep -oP 'ARG COMFYUI_VERSION=\K.*' Dockerfile || echo "unknown") echo "current_version=$CURRENT" >> $GITHUB_OUTPUT
  • VERSION="${{ steps.version.outputs.version }}" sed -i "s/^ARG COMFYUI_VERSION=.*/ARG COMFYUI_VERSION=${VERSION}/" Dockerfile
View raw YAML
name: "CI: Update CI Container"

on:
  release:
    types: [published]
  workflow_dispatch:
    inputs:
      version:
        description: 'ComfyUI version (e.g., v0.7.0)'
        required: true
        type: string

jobs:
  update-ci-container:
    runs-on: ubuntu-latest
    # Skip pre-releases unless manually triggered
    if: github.event_name == 'workflow_dispatch' || !github.event.release.prerelease
    steps:
      - name: Get version
        id: version
        run: |
          if [ "${{ github.event_name }}" = "release" ]; then
            VERSION="${{ github.event.release.tag_name }}"
          else
            VERSION="${{ inputs.version }}"
          fi
          echo "version=$VERSION" >> $GITHUB_OUTPUT

      - name: Checkout comfyui-ci-container
        uses: actions/checkout@v4
        with:
          repository: comfy-org/comfyui-ci-container
          token: ${{ secrets.CI_CONTAINER_PAT }}

      - name: Check current version
        id: current
        run: |
          CURRENT=$(grep -oP 'ARG COMFYUI_VERSION=\K.*' Dockerfile || echo "unknown")
          echo "current_version=$CURRENT" >> $GITHUB_OUTPUT

      - name: Update Dockerfile
        run: |
          VERSION="${{ steps.version.outputs.version }}"
          sed -i "s/^ARG COMFYUI_VERSION=.*/ARG COMFYUI_VERSION=${VERSION}/" Dockerfile

      - name: Create Pull Request
        id: create-pr
        uses: peter-evans/create-pull-request@v7
        with:
          token: ${{ secrets.CI_CONTAINER_PAT }}
          branch: automation/comfyui-${{ steps.version.outputs.version }}
          title: "chore: bump ComfyUI to ${{ steps.version.outputs.version }}"
          body: |
            Updates ComfyUI version from `${{ steps.current.outputs.current_version }}` to `${{ steps.version.outputs.version }}`

            **Triggered by:** ${{ github.event_name == 'release' && format('[Release {0}]({1})', github.event.release.tag_name, github.event.release.html_url) || 'Manual workflow dispatch' }}

          labels: automation
          commit-message: "chore: bump ComfyUI to ${{ steps.version.outputs.version }}"
update-version .github/workflows/update-version.yml
Triggers
pull_request
Runs on
ubuntu-latest
Jobs
update-version
Commands
  • python -m pip install --upgrade pip
  • # Read version from pyproject.toml and update comfyui_version.py python -c ' import tomllib # Read version from pyproject.toml with open("pyproject.toml", "rb") as f: config = tomllib.load(f) version = config["project"]["version"] # Write version to comfyui_version.py with open("comfyui_version.py", "w") as f: f.write("# This file is automatically generated by the build process when version is\n") f.write("# updated in pyproject.toml.\n") f.write(f"__version__ = \"{version}\"\n") '
  • git config --local user.name "github-actions" git config --local user.email "github-actions@github.com" git fetch origin ${{ github.head_ref }} git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }} git add comfyui_version.py git diff --quiet && git diff --staged --quiet || git commit -m "chore: Update comfyui_version.py to match pyproject.toml" git push origin HEAD:${{ github.head_ref }}
View raw YAML
name: Update Version File

on:
  pull_request:
    paths:
      - "pyproject.toml"
    branches:
      - master
      - release/**

jobs:
  update-version:
    runs-on: ubuntu-latest
    # Don't run on fork PRs
    if: github.event.pull_request.head.repo.full_name == github.repository
    permissions:
      pull-requests: write
      contents: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: "3.11"

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip

      - name: Update comfyui_version.py
        run: |
          # Read version from pyproject.toml and update comfyui_version.py
          python -c '
          import tomllib

          # Read version from pyproject.toml
          with open("pyproject.toml", "rb") as f:
              config = tomllib.load(f)
              version = config["project"]["version"]

          # Write version to comfyui_version.py
          with open("comfyui_version.py", "w") as f:
              f.write("# This file is automatically generated by the build process when version is\n")
              f.write("# updated in pyproject.toml.\n")
              f.write(f"__version__ = \"{version}\"\n")
          '

      - name: Commit changes
        run: |
          git config --local user.name "github-actions"
          git config --local user.email "github-actions@github.com"
          git fetch origin ${{ github.head_ref }}
          git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
          git add comfyui_version.py
          git diff --quiet && git diff --staged --quiet || git commit -m "chore: Update comfyui_version.py to match pyproject.toml"
          git push origin HEAD:${{ github.head_ref }}
windows_release_dependencies .github/workflows/windows_release_dependencies.yml
Triggers
workflow_dispatch
Runs on
windows-latest
Jobs
build_dependencies
Commands
  • echo "@echo off call update_comfyui.bat nopause echo - echo This will try to update pytorch and all python dependencies. echo - echo If you just want to update normally, close this and run update_comfyui.bat instead. echo - pause ..\python_embeded\python.exe -s -m pip install --upgrade torch torchvision torchaudio ${{ inputs.xformers }} --extra-index-url https://download.pytorch.org/whl/cu${{ inputs.cu }} -r ../ComfyUI/requirements.txt pygit2 pause" > update_comfyui_and_python_dependencies.bat grep -v comfyui requirements.txt > requirements_nocomfyui.txt python -m pip wheel --no-cache-dir torch torchvision torchaudio ${{ inputs.xformers }} ${{ inputs.extra_dependencies }} --extra-index-url https://download.pytorch.org/whl/cu${{ inputs.cu }} -r requirements_nocomfyui.txt pygit2 -w ./temp_wheel_dir python -m pip install --no-cache-dir ./temp_wheel_dir/* echo installed basic ls -lah temp_wheel_dir mv temp_wheel_dir cu${{ inputs.cu }}_python_deps tar cf cu${{ inputs.cu }}_python_deps.tar cu${{ inputs.cu }}_python_deps
View raw YAML
name: "Windows Release dependencies"

on:
  workflow_dispatch:
    inputs:
      xformers:
        description: 'xformers version'
        required: false
        type: string
        default: ""
      extra_dependencies:
        description: 'extra dependencies'
        required: false
        type: string
        default: ""
      cu:
        description: 'cuda version'
        required: true
        type: string
        default: "130"

      python_minor:
        description: 'python minor version'
        required: true
        type: string
        default: "13"

      python_patch:
        description: 'python patch version'
        required: true
        type: string
        default: "11"
#  push:
#    branches:
#      - master

jobs:
  build_dependencies:
    runs-on: windows-latest
    steps:
        - uses: actions/checkout@v4
        - uses: actions/setup-python@v5
          with:
            python-version: 3.${{ inputs.python_minor }}.${{ inputs.python_patch }}

        - shell: bash
          run: |
            echo "@echo off
            call update_comfyui.bat nopause
            echo -
            echo This will try to update pytorch and all python dependencies.
            echo -
            echo If you just want to update normally, close this and run update_comfyui.bat instead.
            echo -
            pause
            ..\python_embeded\python.exe -s -m pip install --upgrade torch torchvision torchaudio ${{ inputs.xformers }} --extra-index-url https://download.pytorch.org/whl/cu${{ inputs.cu }} -r ../ComfyUI/requirements.txt pygit2
            pause" > update_comfyui_and_python_dependencies.bat

            grep -v comfyui requirements.txt > requirements_nocomfyui.txt
            python -m pip wheel --no-cache-dir torch torchvision torchaudio ${{ inputs.xformers }} ${{ inputs.extra_dependencies }} --extra-index-url https://download.pytorch.org/whl/cu${{ inputs.cu }} -r requirements_nocomfyui.txt pygit2 -w ./temp_wheel_dir
            python -m pip install --no-cache-dir ./temp_wheel_dir/*
            echo installed basic
            ls -lah temp_wheel_dir
            mv temp_wheel_dir cu${{ inputs.cu }}_python_deps
            tar cf cu${{ inputs.cu }}_python_deps.tar cu${{ inputs.cu }}_python_deps

        - uses: actions/cache/save@v4
          with:
            path: |
              cu${{ inputs.cu }}_python_deps.tar
              update_comfyui_and_python_dependencies.bat
            key: ${{ runner.os }}-build-cu${{ inputs.cu }}-${{ inputs.python_minor }}
windows_release_dependencies_manual .github/workflows/windows_release_dependencies_manual.yml
Triggers
workflow_dispatch
Runs on
windows-latest
Jobs
build_dependencies
Commands
  • echo "@echo off call update_comfyui.bat nopause echo - echo This will try to update pytorch and all python dependencies. echo - echo If you just want to update normally, close this and run update_comfyui.bat instead. echo - pause ..\python_embeded\python.exe -s -m pip install --upgrade ${{ inputs.torch_dependencies }} -r ../ComfyUI/requirements.txt pygit2 pause" > update_comfyui_and_python_dependencies.bat grep -v comfyui requirements.txt > requirements_nocomfyui.txt python -m pip wheel --no-cache-dir ${{ inputs.torch_dependencies }} -r requirements_nocomfyui.txt pygit2 -w ./temp_wheel_dir python -m pip install --no-cache-dir ./temp_wheel_dir/* echo installed basic ls -lah temp_wheel_dir mv temp_wheel_dir ${{ inputs.cache_tag }}_python_deps tar cf ${{ inputs.cache_tag }}_python_deps.tar ${{ inputs.cache_tag }}_python_deps
View raw YAML
name: "Windows Release dependencies Manual"

on:
  workflow_dispatch:
    inputs:
      torch_dependencies:
        description: 'torch dependencies'
        required: false
        type: string
        default: "torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu128"
      cache_tag:
        description: 'Cached dependencies tag'
        required: true
        type: string
        default: "cu128"

      python_minor:
        description: 'python minor version'
        required: true
        type: string
        default: "12"

      python_patch:
        description: 'python patch version'
        required: true
        type: string
        default: "10"

jobs:
  build_dependencies:
    runs-on: windows-latest
    steps:
        - uses: actions/checkout@v4
        - uses: actions/setup-python@v5
          with:
            python-version: 3.${{ inputs.python_minor }}.${{ inputs.python_patch }}

        - shell: bash
          run: |
            echo "@echo off
            call update_comfyui.bat nopause
            echo -
            echo This will try to update pytorch and all python dependencies.
            echo -
            echo If you just want to update normally, close this and run update_comfyui.bat instead.
            echo -
            pause
            ..\python_embeded\python.exe -s -m pip install --upgrade ${{ inputs.torch_dependencies }} -r ../ComfyUI/requirements.txt pygit2
            pause" > update_comfyui_and_python_dependencies.bat

            grep -v comfyui requirements.txt > requirements_nocomfyui.txt
            python -m pip wheel --no-cache-dir ${{ inputs.torch_dependencies }} -r requirements_nocomfyui.txt pygit2 -w ./temp_wheel_dir
            python -m pip install --no-cache-dir ./temp_wheel_dir/*
            echo installed basic
            ls -lah temp_wheel_dir
            mv temp_wheel_dir ${{ inputs.cache_tag }}_python_deps
            tar cf ${{ inputs.cache_tag }}_python_deps.tar ${{ inputs.cache_tag }}_python_deps

        - uses: actions/cache/save@v4
          with:
            path: |
              ${{ inputs.cache_tag }}_python_deps.tar
              update_comfyui_and_python_dependencies.bat
            key: ${{ runner.os }}-build-${{ inputs.cache_tag }}-${{ inputs.python_minor }}
windows_release_nightly_pytorch .github/workflows/windows_release_nightly_pytorch.yml
Triggers
workflow_dispatch
Runs on
windows-latest
Jobs
build
Actions
svenstaro/upload-release-action
Commands
  • cd .. cp -r ComfyUI ComfyUI_copy curl https://www.python.org/ftp/python/3.${{ inputs.python_minor }}.${{ inputs.python_patch }}/python-3.${{ inputs.python_minor }}.${{ inputs.python_patch }}-embed-amd64.zip -o python_embeded.zip unzip python_embeded.zip -d python_embeded cd python_embeded echo 'import site' >> ./python3${{ inputs.python_minor }}._pth curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py ./python.exe get-pip.py python -m pip wheel torch torchvision torchaudio --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu${{ inputs.cu }} -r ../ComfyUI/requirements.txt pygit2 -w ../temp_wheel_dir ls ../temp_wheel_dir ./python.exe -s -m pip install --pre ../temp_wheel_dir/* sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth rm ./Lib/site-packages/torch/lib/dnnl.lib #I don't think this is actually used and I need the space cd .. git clone --depth 1 https://github.com/comfyanonymous/taesd cp taesd/*.safetensors ./ComfyUI_copy/models/vae_approx/ mkdir ComfyUI_windows_portable_nightly_pytorch mv python_embeded ComfyUI_windows_portable_nightly_pytorch mv ComfyUI_copy ComfyUI_windows_portable_nightly_pytorch/ComfyUI cd ComfyUI_windows_portable_nightly_pytorch mkdir update cp -r ComfyUI/.ci/update_windows/* ./update/ cp -r ComfyUI/.ci/windows_nvidia_base_files/* ./ cp -r ComfyUI/.ci/windows_nightly_base_files/* ./ echo "call update_comfyui.bat nopause ..\python_embeded\python.exe -s -m pip install --upgrade --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu${{ inputs.cu }} -r ../ComfyUI/requirements.txt pygit2 pause" > ./update/update_comfyui_and_python_dependencies.bat cd .. "C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=9 -mfb=128 -md=512m -ms=on -mf=BCJ2 ComfyUI_windows_portable_nightly_pytorch.7z ComfyUI_windows_portable_nightly_pytorch mv ComfyUI_windows_portable_nightly_pytorch.7z ComfyUI/ComfyUI_windows_portable_nvidia_or_cpu_nightly_pytorch.7z cd ComfyUI_windows_portable_nightly_pytorch python_embeded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu ls
View raw YAML
name: "Windows Release Nightly pytorch"

on:
  workflow_dispatch:
    inputs:
      cu:
        description: 'cuda version'
        required: true
        type: string
        default: "129"

      python_minor:
        description: 'python minor version'
        required: true
        type: string
        default: "13"

      python_patch:
        description: 'python patch version'
        required: true
        type: string
        default: "5"
#  push:
#    branches:
#      - master

jobs:
  build:
    permissions:
        contents: "write"
        packages: "write"
        pull-requests: "read"
    runs-on: windows-latest
    steps:
        - uses: actions/checkout@v4
          with:
            fetch-depth: 30
            persist-credentials: false
        - uses: actions/setup-python@v5
          with:
            python-version: 3.${{ inputs.python_minor }}.${{ inputs.python_patch }}
        - shell: bash
          run: |
            cd ..
            cp -r ComfyUI ComfyUI_copy
            curl https://www.python.org/ftp/python/3.${{ inputs.python_minor }}.${{ inputs.python_patch }}/python-3.${{ inputs.python_minor }}.${{ inputs.python_patch }}-embed-amd64.zip -o python_embeded.zip
            unzip python_embeded.zip -d python_embeded
            cd python_embeded
            echo 'import site' >> ./python3${{ inputs.python_minor }}._pth
            curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
            ./python.exe get-pip.py
            python -m pip wheel torch torchvision torchaudio --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu${{ inputs.cu }} -r ../ComfyUI/requirements.txt pygit2 -w ../temp_wheel_dir
            ls ../temp_wheel_dir
            ./python.exe -s -m pip install --pre ../temp_wheel_dir/*
            sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth

            rm ./Lib/site-packages/torch/lib/dnnl.lib #I don't think this is actually used and I need the space
            cd ..

            git clone --depth 1 https://github.com/comfyanonymous/taesd
            cp taesd/*.safetensors ./ComfyUI_copy/models/vae_approx/

            mkdir ComfyUI_windows_portable_nightly_pytorch
            mv python_embeded ComfyUI_windows_portable_nightly_pytorch
            mv ComfyUI_copy ComfyUI_windows_portable_nightly_pytorch/ComfyUI

            cd ComfyUI_windows_portable_nightly_pytorch

            mkdir update
            cp -r ComfyUI/.ci/update_windows/* ./update/
            cp -r ComfyUI/.ci/windows_nvidia_base_files/* ./
            cp -r ComfyUI/.ci/windows_nightly_base_files/* ./

            echo "call update_comfyui.bat nopause
            ..\python_embeded\python.exe -s -m pip install --upgrade --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu${{ inputs.cu }} -r ../ComfyUI/requirements.txt pygit2
            pause" > ./update/update_comfyui_and_python_dependencies.bat
            cd ..

            "C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=9 -mfb=128 -md=512m -ms=on -mf=BCJ2 ComfyUI_windows_portable_nightly_pytorch.7z ComfyUI_windows_portable_nightly_pytorch
            mv ComfyUI_windows_portable_nightly_pytorch.7z ComfyUI/ComfyUI_windows_portable_nvidia_or_cpu_nightly_pytorch.7z

            cd ComfyUI_windows_portable_nightly_pytorch
            python_embeded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu

            ls

        - name: Upload binaries to release
          uses: svenstaro/upload-release-action@v2
          with:
                repo_token: ${{ secrets.GITHUB_TOKEN }}
                file: ComfyUI_windows_portable_nvidia_or_cpu_nightly_pytorch.7z
                tag: "latest"
                overwrite: true
windows_release_package .github/workflows/windows_release_package.yml
Triggers
workflow_dispatch
Runs on
windows-latest
Jobs
package_comfyui
Actions
svenstaro/upload-release-action
Commands
  • mv cu${{ inputs.cu }}_python_deps.tar ../ mv update_comfyui_and_python_dependencies.bat ../ cd .. tar xf cu${{ inputs.cu }}_python_deps.tar pwd ls
  • cd .. cp -r ComfyUI ComfyUI_copy curl https://www.python.org/ftp/python/3.${{ inputs.python_minor }}.${{ inputs.python_patch }}/python-3.${{ inputs.python_minor }}.${{ inputs.python_patch }}-embed-amd64.zip -o python_embeded.zip unzip python_embeded.zip -d python_embeded cd python_embeded echo 'import site' >> ./python3${{ inputs.python_minor }}._pth curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py ./python.exe get-pip.py ./python.exe -s -m pip install ../cu${{ inputs.cu }}_python_deps/* sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth rm ./Lib/site-packages/torch/lib/dnnl.lib #I don't think this is actually used and I need the space rm ./Lib/site-packages/torch/lib/libprotoc.lib rm ./Lib/site-packages/torch/lib/libprotobuf.lib cd .. git clone --depth 1 https://github.com/comfyanonymous/taesd cp taesd/*.safetensors ./ComfyUI_copy/models/vae_approx/ mkdir ComfyUI_windows_portable mv python_embeded ComfyUI_windows_portable mv ComfyUI_copy ComfyUI_windows_portable/ComfyUI cd ComfyUI_windows_portable mkdir update cp -r ComfyUI/.ci/update_windows/* ./update/ cp -r ComfyUI/.ci/windows_nvidia_base_files/* ./ cp ../update_comfyui_and_python_dependencies.bat ./update/ cd .. "C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=9 -mfb=128 -md=768m -ms=on -mf=BCJ2 ComfyUI_windows_portable.7z ComfyUI_windows_portable mv ComfyUI_windows_portable.7z ComfyUI/new_ComfyUI_windows_portable_nvidia_cu${{ inputs.cu }}_or_cpu.7z cd ComfyUI_windows_portable python_embeded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu python_embeded/python.exe -s ./update/update.py ComfyUI/ ls
View raw YAML
name: "Windows Release packaging"

on:
  workflow_dispatch:
    inputs:
      cu:
        description: 'cuda version'
        required: true
        type: string
        default: "129"

      python_minor:
        description: 'python minor version'
        required: true
        type: string
        default: "13"

      python_patch:
        description: 'python patch version'
        required: true
        type: string
        default: "6"
#  push:
#    branches:
#      - master

jobs:
  package_comfyui:
    permissions:
        contents: "write"
        packages: "write"
        pull-requests: "read"
    runs-on: windows-latest
    steps:
        - uses: actions/cache/restore@v4
          id: cache
          with:
            path: |
              cu${{ inputs.cu }}_python_deps.tar
              update_comfyui_and_python_dependencies.bat
            key: ${{ runner.os }}-build-cu${{ inputs.cu }}-${{ inputs.python_minor }}
        - shell: bash
          run: |
            mv cu${{ inputs.cu }}_python_deps.tar ../
            mv update_comfyui_and_python_dependencies.bat ../
            cd ..
            tar xf cu${{ inputs.cu }}_python_deps.tar
            pwd
            ls

        - uses: actions/checkout@v4
          with:
            fetch-depth: 150
            persist-credentials: false
        - shell: bash
          run: |
            cd ..
            cp -r ComfyUI ComfyUI_copy
            curl https://www.python.org/ftp/python/3.${{ inputs.python_minor }}.${{ inputs.python_patch }}/python-3.${{ inputs.python_minor }}.${{ inputs.python_patch }}-embed-amd64.zip -o python_embeded.zip
            unzip python_embeded.zip -d python_embeded
            cd python_embeded
            echo 'import site' >> ./python3${{ inputs.python_minor }}._pth
            curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
            ./python.exe get-pip.py
            ./python.exe -s -m pip install ../cu${{ inputs.cu }}_python_deps/*
            sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth

            rm ./Lib/site-packages/torch/lib/dnnl.lib #I don't think this is actually used and I need the space
            rm ./Lib/site-packages/torch/lib/libprotoc.lib
            rm ./Lib/site-packages/torch/lib/libprotobuf.lib
            cd ..

            git clone --depth 1 https://github.com/comfyanonymous/taesd
            cp taesd/*.safetensors ./ComfyUI_copy/models/vae_approx/

            mkdir ComfyUI_windows_portable
            mv python_embeded ComfyUI_windows_portable
            mv ComfyUI_copy ComfyUI_windows_portable/ComfyUI

            cd ComfyUI_windows_portable

            mkdir update
            cp -r ComfyUI/.ci/update_windows/* ./update/
            cp -r ComfyUI/.ci/windows_nvidia_base_files/* ./
            cp ../update_comfyui_and_python_dependencies.bat ./update/

            cd ..

            "C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=9 -mfb=128 -md=768m -ms=on -mf=BCJ2 ComfyUI_windows_portable.7z ComfyUI_windows_portable
            mv ComfyUI_windows_portable.7z ComfyUI/new_ComfyUI_windows_portable_nvidia_cu${{ inputs.cu }}_or_cpu.7z

            cd ComfyUI_windows_portable
            python_embeded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu

            python_embeded/python.exe -s ./update/update.py ComfyUI/

            ls

        - name: Upload binaries to release
          uses: svenstaro/upload-release-action@v2
          with:
                repo_token: ${{ secrets.GITHUB_TOKEN }}
                file: new_ComfyUI_windows_portable_nvidia_cu${{ inputs.cu }}_or_cpu.7z
                tag: "latest"
                overwrite: true