Skip to content

Commit

Permalink
Handle u2net.onnx to skip downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
YanWenKun committed Sep 29, 2024
1 parent aacf734 commit 1fc420c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions attachments/run_nvidia_gpu.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ set PATH=%PATH%;%~dp0\python_embeded\Scripts
@REM 该行命令会使 .pyc 文件集中保存在一处。
set PYTHONPYCACHEPREFIX=.\pycache

@REM This command will copy u2net.onnx to user's home path, to skip download at first start.
@REM 该行命令会复制 u2net.onnx 到用户主目录下,以免启动时还需下载。
IF NOT EXIST "%USERPROFILE%\.u2net\u2net.onnx" (
IF EXIST ".\extras\u2net.onnx" (
mkdir "%USERPROFILE%\.u2net" 2>nul
copy ".\extras\u2net.onnx" "%USERPROFILE%\.u2net\u2net.onnx"
)
)

@REM If you don't want the browser to open automatically, add " --disable-auto-launch" (without quotation marks) to the end of the line below.
@REM 如果不想要 ComfyUI 启动后自动打开浏览器,添加" --disable-auto-launch"(不含引号)到下行末尾。
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
Expand Down
5 changes: 5 additions & 0 deletions stage2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ $gcs https://github.com/ltdrdata/ComfyUI-Impact-Subpack.git impact_subpack
cd "$workdir"/ComfyUI_Windows_portable
./python_embeded/python.exe -s -B ComfyUI/main.py --quick-test-for-ci --cpu

# Copy model files from ~/
cd "$workdir"/ComfyUI_Windows_portable
mkdir extras
cp ~/.u2net/u2net.onnx ./extras/u2net.onnx

# Clean up
rm "$workdir"/ComfyUI_Windows_portable/*.log
# DO NOT clean pymatting cache, they are nbi/nbc files for Numba, and won't be regenerated.
Expand Down

0 comments on commit 1fc420c

Please sign in to comment.