Skip to content

Commit

Permalink
new 3-in-1 build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
YanWenKun committed Apr 1, 2024
1 parent 8ca1c27 commit 904f4dc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- shell: bash
run: bash step1.sh
- name: Stage 1 Gathering Dependencies
shell: bash
run: bash stage1.sh

- shell: bash
run: bash step2.sh
- name: Stage 2 Assembling Repositories
shell: bash
run: bash stage2.sh

- name: Stage 3 Compressing Package
shell: bash
run: bash stage3.sh

- name: Upload archive to release
uses: xresloader/upload-to-github-release@v1
Expand Down
4 changes: 4 additions & 0 deletions stage1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ workdir=$(pwd)

export PYTHONPYCACHEPREFIX="$workdir"/pycache

ls -lahF

# Setup Python embeded, part 1/3
curl https://www.python.org/ftp/python/3.11.8/python-3.11.8-embed-amd64.zip \
-o python_embeded.zip
Expand Down Expand Up @@ -61,6 +63,8 @@ rm -rf "$workdir"/ComfyUI-3D-Pack
# Setup Python embeded, part 3/3
sed -i '1i../ComfyUI' ./python311._pth

./python.exe -s -m pip list

cd "$workdir"

du -hd1
8 changes: 1 addition & 7 deletions stage2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ workdir=$(pwd)

export PYTHONPYCACHEPREFIX="$workdir"/pycache

du -hd1
ls -lahF

mkdir -p "$workdir"/ComfyUI_Windows_portable

Expand Down Expand Up @@ -85,12 +85,6 @@ rm ./ComfyUI-Manager/config.ini
rm ./ComfyUI-Impact-Pack/impact-pack.ini
rm ./ComfyUI-Custom-Scripts/pysssss.json

du -hd1 "$workdir"

# Packaging
cd "$workdir"
# LZMA2 is ~1.8x faster
"C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=5 -mfb=32 -md=16m -ms=on -mf=BCJ2 -v2100000000b ComfyUI_Windows_portable_cu121.7z ComfyUI_Windows_portable

cd "$workdir"
ls -lahF
12 changes: 12 additions & 0 deletions stage3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -eux

ls -lahF

du -hd1

# LZMA2 is ~75% faster than LZMA, but consumes more RAM
# Use 2140000000b as volume size just because GitHub think 2147483648b is "larger than 2GB"
"C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=7 -mfb=64 -md=32m -ms=on -mf=BCJ2 -v2140000000b ComfyUI_Windows_portable_cu121.7z ComfyUI_Windows_portable

ls -lahF

0 comments on commit 904f4dc

Please sign in to comment.