Embedded Windows Release Dependencies #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Embedded 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: "\"numpy<2\"" | |
cu: | |
description: 'cuda version' | |
required: true | |
type: string | |
default: "124" | |
python_minor: | |
description: 'python minor version' | |
required: true | |
type: string | |
default: "11" | |
python_patch: | |
description: 'python patch version' | |
required: true | |
type: string | |
default: "9" | |
jobs: | |
build_and_release_dependencies: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download and extract embedded Python | |
shell: bash | |
run: | | |
git clone https://github.com/comfyanonymous/ComfyUI --depth 1 | |
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_embedded.zip | |
unzip python_embedded.zip -d python_embedded | |
cd python_embedded | |
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 -m pip install torch torchvision torchaudio ${{ inputs.xformers }} ${{ inputs.extra_dependencies }} --extra-index-url https://download.pytorch.org/whl/cu${{ inputs.cu }} -r ../ComfyUI/requirements.txt pygit2 | |
sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth | |
cd ../ | |
git clone --depth 1 https://github.com/comfyanonymous/taesd | |
cp taesd/*.pth ./ComfyUI/models/vae_approx/ | |
mkdir ComfyUI_windows_portable | |
mv ComfyUI ComfyUI_windows_portable | |
mv python_embedded ComfyUI_windows_portable | |
"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 | |
cd ComfyUI_windows_portable | |
python_embedded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu | |
cd ../ && ls | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: embedded-windows-deps-cu${{ inputs.cu }}-py${{ inputs.python_minor }}.${{ inputs.python_patch }}-${{ github.run_number }} | |
name: Embedded Windows Dependencies CUDA ${{ inputs.cu }} Python ${{ inputs.python_minor }}.${{ inputs.python_patch }} (Build ${{ github.run_number }}) | |
body: | | |
Windows dependencies for CUDA ${{ inputs.cu }} and Python ${{ inputs.python_minor }}.${{ inputs.python_patch }} | |
Includes: | |
- Embedded Python ${{ inputs.python_minor }}.${{ inputs.python_patch }} | |
- PyTorch dependencies for CUDA ${{ inputs.cu }} | |
- ComfyUI requirements | |
draft: false | |
prerelease: true | |
artifacts: "ComfyUI_windows_portable.7z" | |
token: ${{ secrets.GITHUB_TOKEN }} |