-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (89 loc) · 3.57 KB
/
windows-packages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: "Windows Release Dependencies with Stable PyTorch"
on:
workflow_dispatch:
inputs:
spec_file:
description: 'spec file'
required: true
type: string
default: "ComfyUI.spec"
python_minor:
description: 'python minor version'
required: true
type: string
default: "12"
cu:
description: 'cuda version'
required: true
type: string
default: "124"
extra_dependencies:
description: 'extra dependencies'
required: false
type: string
default: "\"numpy<2\""
jobs:
build_and_release_dependencies:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.${{ inputs.python_minor }}'
- name: Create virtual environment
run: |
python -m venv packaged_env
.\packaged_env\Scripts\Activate.ps1
python -m pip install --upgrade pip
- name: Install PyTorch Stable
run: |
.\packaged_env\Scripts\Activate.ps1
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu${{ inputs.cu }}
- name: Fetch and install ComfyUI requirements
run: |
.\packaged_env\Scripts\Activate.ps1
Invoke-WebRequest -Uri https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/requirements.txt -OutFile requirements.txt
pip install ${{ inputs.extra_dependencies }} -r requirements.txt
- name: Verify PyTorch installation
run: |
.\packaged_env\Scripts\Activate.ps1
python -c "import torch; print(f'PyTorch version: {torch.__version__}')"
python -c "import torch; print(f'PyTorch installation directory: {torch.__file__}')"
python -c "import torchvision; print(f'torchvision version: {torchvision.__version__}')"
python -c "import torchaudio; print(f'torchaudio version: {torchaudio.__version__}')"
- name: Package environment
run: |
.\packaged_env\Scripts\Activate.ps1
pip install pyinstaller
git clone https://github.com/comfyanonymous/ComfyUI --depth 1
Copy-Item ${{ inputs.spec_file }} -Destination ComfyUI\
cd ComfyUI
pyinstaller ${{ inputs.spec_file }}
- name: Zip environment
shell: bash
run: |
cd ComfyUI
"C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=8 -mfb=64 -md=32m -ms=on -mf=BCJ2 windows_python_env.7z dist
- name: Get current date
id: date
shell: bash
run: echo "datetime=$(Get-Date -Format 'yyyy-MM-dd-HHmmss')" >> $env:GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: windows-deps-py3.${{ inputs.python_minor }}-${{ steps.date.outputs.datetime }}
name: Windows Dependencies Python 3.${{ inputs.python_minor }} (${{ steps.date.outputs.datetime }})
body: |
Windows dependencies with CUDA PyTorch
Build Date: ${{ steps.date.outputs.datetime }}
Includes:
- Python 3.${{ inputs.python_minor }} virtual environment
- PyTorch Cuda ${{ inputs.cu }}
- Spec File ${{ inputs.spec_file }}
- ComfyUI requirements
- Extra dependencies: ${{ inputs.extra_dependencies }}
draft: false
prerelease: true
artifacts: "ComfyUI/windows_python_env.7z"
token: ${{ secrets.GITHUB_TOKEN }}