Skip to content

Commit

Permalink
step2 preload some models from custom nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
YanWenKun committed Mar 26, 2024
1 parent 99d2979 commit 76cafe3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
1 change: 0 additions & 1 deletion .github/workflows/step2-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ jobs:
file: "ComfyUI_Windows_portable_cu121.7z*"
delete_file: true
update_latest_release: true
verbose: true
33 changes: 20 additions & 13 deletions step2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,29 @@ mkdir update
cp -r ComfyUI/.ci/update_windows/* ./update/
cp -r ComfyUI/.ci/windows_base_files/* ./

cd "$workdir"
# LZMA2 is way more faster
"C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=5 -mfb=32 -md=16m -ms=on -mf=BCJ2 -v2000000000b ComfyUI_Windows_portable_cu121.7z ComfyUI_Windows_portable
du -hd1 "$workdir"

ls -lah
# Run test, also let custom nodes download some models
cd "$workdir"/ComfyUI_Windows_portable
export PYTHONPYCACHEPREFIX=/tmp/pycache
./python_embeded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu

# Clean up
rm "$workdir"/ComfyUI_Windows_portable/*.log
rm -rf "$workdir"/ComfyUI_Windows_portable/python_embeded/Lib/site-packages/pymatting

# For test run, disable custom nodes
cd "$workdir"/ComfyUI_Windows_portable/ComfyUI/custom_nodes
for D in *; do
if [ -d "${D}" ]; then
mv "${D}" "${D}".disabled
fi
done
rm ./was-node-suite-comfyui/was_suite_config.json
rm ./ComfyUI-Manager/config.ini
rm ./ComfyUI-Impact-Pack/impact-pack.ini
rm ./ComfyUI-Custom-Scripts/pysssss.json

cd "$workdir"/ComfyUI_Windows_portable
python_embeded/python.exe -s ComfyUI/main.py --quick-test-for-ci --cpu
du -hd1 "$workdir"

# Packaging
cd "$workdir"
du -hd1
# 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 -v2000000000b ComfyUI_Windows_portable_cu121.7z ComfyUI_Windows_portable

cd "$workdir"
ls -lahF

0 comments on commit 76cafe3

Please sign in to comment.