mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-21 12:07:01 +08:00
add cpu build (#2)
* add cpu * add * fix * fix * fix * fix * conditional cache * use-cpu * fix * add reusable * add * fix * fix * add * add * fix deps * secrets: inherit * numpy<2.0 * add * refine
This commit is contained in:
parent
971dd11f95
commit
136ef625cc
66
.github/workflows/build_bizy.yml
vendored
Normal file
66
.github/workflows/build_bizy.yml
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
name: "Build BizyAir"
|
||||
|
||||
on:
|
||||
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: "8"
|
||||
|
||||
cpu:
|
||||
description: 'if it is a cpu build'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
xformers:
|
||||
description: 'xformers version'
|
||||
required: false
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
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 || 8 }}
|
||||
cpu: ${{ inputs.cpu || true }}
|
||||
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 || 8 }}
|
||||
cpu: ${{ inputs.cpu || true }}
|
||||
@ -1,6 +1,43 @@
|
||||
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: "8"
|
||||
|
||||
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:
|
||||
xformers:
|
||||
@ -25,20 +62,42 @@ on:
|
||||
required: true
|
||||
type: string
|
||||
default: "8"
|
||||
|
||||
cpu:
|
||||
description: 'if it is a cpu build'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
# 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=cpu" >> $GITHUB_ENV
|
||||
- uses: actions/cache/restore@v4
|
||||
id: cache
|
||||
if: github.event_name != 'workflow_dispatch' && !(github.event.inputs.force || false)
|
||||
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
|
||||
@ -48,19 +107,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 }} --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 }} --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 }}
|
||||
|
||||
81
.github/workflows/windows_release_package.yml
vendored
81
.github/workflows/windows_release_package.yml
vendored
@ -20,6 +20,40 @@ on:
|
||||
required: true
|
||||
type: string
|
||||
default: "8"
|
||||
|
||||
cpu:
|
||||
description: 'if it is a cpu build'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
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: "8"
|
||||
|
||||
cpu:
|
||||
description: 'if it is a cpu build'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
env:
|
||||
BIZY_VARIANT: cu${{ inputs.cu }}
|
||||
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
@ -32,26 +66,29 @@ jobs:
|
||||
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
|
||||
|
||||
- if: ${{ inputs.cpu == true }}
|
||||
shell: bash
|
||||
run: echo "BIZY_VARIANT=cpu" >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- uses: actions/cache/restore@v4
|
||||
id: cache
|
||||
with:
|
||||
path: |
|
||||
${{ env.BIZY_VARIANT }}_python_deps.tar
|
||||
update_comfyui_and_python_dependencies.bat
|
||||
key: ${{ runner.os }}-build-${{ env.BIZY_VARIANT }}-${{ inputs.python_minor }}
|
||||
fail-on-cache-miss: true
|
||||
- shell: bash
|
||||
run: |
|
||||
mv ${{ env.BIZY_VARIANT }}_python_deps.tar ../
|
||||
mv update_comfyui_and_python_dependencies.bat ../
|
||||
cd ..
|
||||
tar xf ${{ env.BIZY_VARIANT }}_python_deps.tar
|
||||
pwd
|
||||
ls
|
||||
- uses: actions/checkout@v4
|
||||
name: Checkout BizyAir
|
||||
with:
|
||||
@ -67,12 +104,12 @@ 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 https://github.com/comfyanonymous/taesd
|
||||
cp taesd/*.pth ./ComfyUI_copy/models/vae_approx/
|
||||
# git clone https://github.com/comfyanonymous/taesd
|
||||
# cp taesd/*.pth ./ComfyUI_copy/models/vae_approx/
|
||||
|
||||
mkdir ComfyUI_windows_portable
|
||||
mv python_embeded ComfyUI_windows_portable
|
||||
@ -88,7 +125,7 @@ jobs:
|
||||
cd ..
|
||||
|
||||
"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
|
||||
@ -99,7 +136,7 @@ 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
|
||||
|
||||
@ -110,4 +147,4 @@ jobs:
|
||||
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_cu${{ inputs.cu }}_or_cpu.7z oss://bizy-air/
|
||||
- run: ossutil cp -f new_ComfyUI_windows_portable_nvidia_${{ env.BIZY_VARIANT }}_or_cpu.7z oss://bizy-air/
|
||||
|
||||
@ -16,3 +16,6 @@ psutil
|
||||
kornia>=0.7.1
|
||||
spandrel
|
||||
soundfile
|
||||
|
||||
#bizy specific dependencies
|
||||
numpy<2.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user