diff --git a/.github/workflows/auto-rebase.yml b/.github/workflows/auto-rebase.yml new file mode 100644 index 000000000000..f17cc4dbf170 --- /dev/null +++ b/.github/workflows/auto-rebase.yml @@ -0,0 +1,38 @@ +name: Auto Rebase + +on: + schedule: + - cron: '0 * * * *' # This will run every hour + push: + branches: + - master # Change this to the branch you want to watch for updates + workflow_dispatch: # Allows manual triggering of the action + +permissions: + id-token: write + contents: write + +jobs: + rebase: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all history for all branches and tags + + - name: Add upstream remote + run: git remote add upstream https://github.com/comfyanonymous/ComfyUI.git + + - name: Fetch upstream changes + run: git fetch upstream + + - name: Rebase branch + run: | + git config --global user.email jackalcooper@gmail.com + git config --global user.name tsai + git checkout master + git rebase upstream/master + + - name: Push changes + run: git push origin master --force diff --git a/.github/workflows/build_bizy.yml b/.github/workflows/build_bizy.yml new file mode 100644 index 000000000000..bd4d9c4200be --- /dev/null +++ b/.github/workflows/build_bizy.yml @@ -0,0 +1,76 @@ +name: "Build BizyAir" + +on: + schedule: + - cron: '0 */8 * * *' # This will run every 8 hours + push: + branches: + - use-cpu + + workflow_dispatch: + inputs: + cu: + description: 'cuda version' + required: true + type: string + default: "121" + + python_minor: + description: 'python minor version' + required: true + type: string + default: "11" + + python_patch: + description: 'python patch version' + required: true + type: string + default: "9" + + cpu: + description: 'if it is a cpu build' + required: false + type: boolean + default: true + + xformers: + description: 'xformers version' + required: false + type: string + default: "" + + + force: + description: 'force update the dependencies' + required: false + type: boolean + default: false + +concurrency: + group: bizyairui_releases-build-cpu${{ inputs.cpu }}-${{ inputs.python_minor }}-xformers${{ inputs.xformers }}-${{ inputs.python_patch }}-${{ inputs.python_minor }}-${{ inputs.cu }} + cancel-in-progress: true + +jobs: + deps: + uses: ./.github/workflows/windows_release_dependencies.yml + secrets: inherit + with: + xformers: ${{ inputs.xformers || '' }} + cu: ${{ inputs.cu || 121 }} + python_minor: ${{ inputs.python_minor || 11 }} + python_patch: ${{ inputs.python_patch || 9 }} + cpu: ${{ inputs.cpu || true }} + force: ${{ inputs.force || false }} + build: + needs: deps + uses: ./.github/workflows/windows_release_package.yml + permissions: + contents: write + packages: write + pull-requests: read + secrets: inherit + with: + cu: ${{ inputs.cu || 121 }} + python_minor: ${{ inputs.python_minor || 11 }} + python_patch: ${{ inputs.python_patch || 9 }} + cpu: ${{ inputs.cpu || true }} diff --git a/.github/workflows/windows_release_dependencies.yml b/.github/workflows/windows_release_dependencies.yml index 8d3a8665ded9..531d02231b60 100644 --- a/.github/workflows/windows_release_dependencies.yml +++ b/.github/workflows/windows_release_dependencies.yml @@ -1,8 +1,57 @@ name: "Windows Release dependencies" on: + workflow_call: + inputs: + xformers: + description: 'xformers version' + required: false + type: string + default: "" + cu: + description: 'cuda version' + required: true + type: string + default: "121" + + python_minor: + description: 'python minor version' + required: true + type: string + default: "11" + + python_patch: + description: 'python patch version' + required: true + type: string + default: "9" + + cpu: + description: 'if it is a cpu build' + required: false + type: boolean + default: true + + force: + description: 'force update the dependencies' + required: false + type: boolean + default: false + workflow_dispatch: inputs: + cpu: + description: 'if it is a cpu build' + required: false + type: boolean + default: true + + force: + description: 'force update the dependencies' + required: false + type: boolean + default: true + xformers: description: 'xformers version' required: false @@ -30,20 +79,37 @@ on: required: true type: string default: "9" + # push: # branches: # - master +env: + BIZY_VARIANT: cu${{ inputs.cu }} + jobs: build_dependencies: runs-on: windows-latest steps: + - if: ${{ inputs.cpu == true }} + shell: bash + run: echo "BIZY_VARIANT=none" >> $GITHUB_ENV + - uses: actions/cache/restore@v4 + id: cache + if: ${{ !inputs.force }} + with: + path: | + ${{ env.BIZY_VARIANT }}_python_deps.tar + update_comfyui_and_python_dependencies.bat + key: ${{ runner.os }}-build-${{ env.BIZY_VARIANT }}-${{ inputs.python_minor }} - uses: actions/checkout@v4 + if: ${{ !steps.cache.outputs.cache-hit }} - uses: actions/setup-python@v5 + if: ${{ !steps.cache.outputs.cache-hit }} with: python-version: 3.${{ inputs.python_minor }}.${{ inputs.python_patch }} - - shell: bash + if: ${{ !steps.cache.outputs.cache-hit }} run: | echo "@echo off call update_comfyui.bat nopause @@ -53,19 +119,20 @@ jobs: 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 + ..\python_embeded\python.exe -s -m pip install --upgrade torch torchvision torchaudio ${{ inputs.xformers }} --extra-index-url https://download.pytorch.org/whl/${{ env.BIZY_VARIANT }} -r ../ComfyUI/requirements.txt pygit2 pause" > update_comfyui_and_python_dependencies.bat - 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.txt pygit2 -w ./temp_wheel_dir + python -m pip wheel --no-cache-dir torch torchvision torchaudio ${{ inputs.xformers }} ${{ inputs.extra_dependencies }} --extra-index-url https://download.pytorch.org/whl/${{ env.BIZY_VARIANT }} -r requirements.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 + mv temp_wheel_dir ${{ env.BIZY_VARIANT }}_python_deps + tar cf ${{ env.BIZY_VARIANT }}_python_deps.tar ${{ env.BIZY_VARIANT }}_python_deps - uses: actions/cache/save@v4 + if: ${{ !steps.cache.outputs.cache-hit }} with: path: | - cu${{ inputs.cu }}_python_deps.tar + ${{ env.BIZY_VARIANT }}_python_deps.tar update_comfyui_and_python_dependencies.bat - key: ${{ runner.os }}-build-cu${{ inputs.cu }}-${{ inputs.python_minor }} + key: ${{ runner.os }}-build-${{ env.BIZY_VARIANT }}-${{ inputs.python_minor }} diff --git a/.github/workflows/windows_release_package.yml b/.github/workflows/windows_release_package.yml index 84d99b8a6b08..cdd44765547f 100644 --- a/.github/workflows/windows_release_package.yml +++ b/.github/workflows/windows_release_package.yml @@ -1,8 +1,40 @@ name: "Windows Release packaging" on: + workflow_call: + inputs: + cu: + description: 'cuda version' + required: true + type: string + default: "121" + + python_minor: + description: 'python minor version' + required: true + type: string + default: "11" + + python_patch: + description: 'python patch version' + required: true + type: string + default: "9" + + cpu: + description: 'if it is a cpu build' + required: false + type: boolean + default: true + workflow_dispatch: inputs: + cpu: + description: 'if it is a cpu build' + required: false + type: boolean + default: true + cu: description: 'cuda version' required: true @@ -20,6 +52,10 @@ on: required: true type: string default: "9" + +env: + BIZY_VARIANT: cu${{ inputs.cu }} + # push: # branches: # - master @@ -32,26 +68,34 @@ jobs: pull-requests: "read" runs-on: windows-latest steps: + - if: ${{ inputs.cpu == true }} + shell: bash + run: echo "BIZY_VARIANT=none" >> $GITHUB_ENV + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false - uses: actions/cache/restore@v4 id: cache with: path: | - cu${{ inputs.cu }}_python_deps.tar + ${{ env.BIZY_VARIANT }}_python_deps.tar update_comfyui_and_python_dependencies.bat - key: ${{ runner.os }}-build-cu${{ inputs.cu }}-${{ inputs.python_minor }} + key: ${{ runner.os }}-build-${{ env.BIZY_VARIANT }}-${{ inputs.python_minor }} + fail-on-cache-miss: true - shell: bash run: | - mv cu${{ inputs.cu }}_python_deps.tar ../ + mv ${{ env.BIZY_VARIANT }}_python_deps.tar ../ mv update_comfyui_and_python_dependencies.bat ../ cd .. - tar xf cu${{ inputs.cu }}_python_deps.tar + tar xf ${{ env.BIZY_VARIANT }}_python_deps.tar pwd ls - - uses: actions/checkout@v4 + name: Checkout BizyAir with: - fetch-depth: 0 - persist-credentials: false + repository: siliconflow/BizyAir + path: custom_nodes/BizyAir - shell: bash run: | cd .. @@ -62,13 +106,10 @@ jobs: 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/* + ./python.exe -s -m pip install ../${{ env.BIZY_VARIANT }}_python_deps/* sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth cd .. - git clone --depth 1 https://github.com/comfyanonymous/taesd - cp taesd/*.pth ./ComfyUI_copy/models/vae_approx/ - mkdir ComfyUI_windows_portable mv python_embeded ComfyUI_windows_portable mv ComfyUI_copy ComfyUI_windows_portable/ComfyUI @@ -82,8 +123,9 @@ jobs: cd .. + find ComfyUI_windows_portable -type d -name "__pycache__" -exec rm -r {} + "C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=8 -mfb=64 -md=32m -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 + mv ComfyUI_windows_portable.7z ComfyUI/new_ComfyUI_windows_portable_nvidia_${{ env.BIZY_VARIANT }}_or_cpu.7z cd ComfyUI_windows_portable python_embeded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu @@ -94,7 +136,15 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: new_ComfyUI_windows_portable_nvidia_cu${{ inputs.cu }}_or_cpu.7z + file: new_ComfyUI_windows_portable_nvidia_${{ env.BIZY_VARIANT }}_or_cpu.7z tag: "latest" overwrite: true + - uses: yizhoumo/setup-ossutil@v2 + with: + ossutil-version: '1.7.18' + endpoint: oss-cn-beijing.aliyuncs.com + access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }} + access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }} + + - run: ossutil cp -f new_ComfyUI_windows_portable_nvidia_${{ env.BIZY_VARIANT }}_or_cpu.7z oss://bizy-air/ diff --git a/requirements.txt b/requirements.txt index 4c2c0b2b2215..40b7674cf24e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,3 +18,6 @@ psutil kornia>=0.7.1 spandrel soundfile + +#bizy specific dependencies +numpy<2.0