From 190fd6a122f2b0889e9943e56710950ac6fda99b Mon Sep 17 00:00:00 2001 From: YAN Wenkun Date: Wed, 11 Dec 2024 17:08:28 +0800 Subject: [PATCH] better scripts --- pt24-cu121/attachments/force-update-all.sh | 2 +- pt24-cu121/attachments/reinstall-deps-for-3d.bat | 4 ++-- pt24-cu121/attachments/run.bat | 7 +++---- .../run_cn.bat" | 12 ++---------- ...5\205\250\351\203\250\350\212\202\347\202\271.sh" | 4 ++-- ...53D-Pack\344\276\235\350\265\226\351\241\271.bat" | 2 +- pt24-cu121/stage2.sh | 5 +++++ pt25-cu124/attachments/reinstall-deps-for-3d.bat | 2 +- .../run_cn.bat" | 2 +- ...53D-Pack\344\276\235\350\265\226\351\241\271.bat" | 2 +- 10 files changed, 19 insertions(+), 23 deletions(-) diff --git a/pt24-cu121/attachments/force-update-all.sh b/pt24-cu121/attachments/force-update-all.sh index e5e248b..f827088 100644 --- a/pt24-cu121/attachments/force-update-all.sh +++ b/pt24-cu121/attachments/force-update-all.sh @@ -20,7 +20,7 @@ git_pull ComfyUI cd ./ComfyUI/custom_nodes for D in *; do - if [ -d "${D}" ]; then + if [ -d "${D}" ] && [ "${D}" != "ComfyUI-3D-Pack" ]; then git_pull "${D}" & fi done diff --git a/pt24-cu121/attachments/reinstall-deps-for-3d.bat b/pt24-cu121/attachments/reinstall-deps-for-3d.bat index ab9a638..f8fe1cb 100644 --- a/pt24-cu121/attachments/reinstall-deps-for-3d.bat +++ b/pt24-cu121/attachments/reinstall-deps-for-3d.bat @@ -12,7 +12,7 @@ echo affect the existing python_embeded. echo Regardless of success or failure, the temporary files will not be deleted. echo ################################################################################ echo Require environment: C++ Build Tools (Visual Studio 2022), CUDA Toolkit, Git. -echo Recommend to edit TORCH_CUDA_ARCH_LIST in this script to save build time. +echo Recommend to edit TORCH_CUDA_ARCH_LIST in this script to reduce build time. echo ################################################################################ echo Press Enter to continue... @@ -58,6 +58,6 @@ echo Build complete, installing... del .\tmp_build\numpy-2*.whl -for %i in (.\tmp_build\*.whl) do .\python_embeded\python.exe -s -m pip install --force-reinstall "%i" +for %%i in (.\tmp_build\*.whl) do .\python_embeded\python.exe -s -m pip install --force-reinstall "%%i" .\python_embeded\python.exe -s -m pip install numpy==1.26.4 diff --git a/pt24-cu121/attachments/run.bat b/pt24-cu121/attachments/run.bat index 263b734..51766b3 100644 --- a/pt24-cu121/attachments/run.bat +++ b/pt24-cu121/attachments/run.bat @@ -1,3 +1,6 @@ +@REM Edit this first! According to your GPU model. +set TORCH_CUDA_ARCH_LIST=6.1+PTX + @REM To set proxy, edit and uncomment the two lines below (remove 'rem ' in the beginning of line). rem set HTTP_PROXY=http://localhost:1081 rem set HTTPS_PROXY=http://localhost:1081 @@ -14,10 +17,6 @@ rem set HF_TOKEN= @REM https://huggingface.co/docs/huggingface_hub/hf_transfer rem set HF_HUB_ENABLE_HF_TRANSFER=1 -@REM In order to save your time on compiling PyTorch JIT CPP extensions, edit this line according to your GPU arch. -@REM Ref: https://github.com/ashawkey/stable-dreamfusion/issues/360#issuecomment-2292510049 -set TORCH_CUDA_ARCH_LIST=5.2+PTX;6.0;6.1+PTX;7.5;8.0;8.6;8.9+PTX - @REM This command redirects HuggingFace-Hub to download model files in this folder. set HF_HUB_CACHE=%~dp0\HuggingFaceHub diff --git "a/pt24-cu121/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/run_cn.bat" "b/pt24-cu121/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/run_cn.bat" index 6898f54..3b68ce2 100644 --- "a/pt24-cu121/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/run_cn.bat" +++ "b/pt24-cu121/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/run_cn.bat" @@ -1,13 +1,5 @@ -@REM 依照下表,修改为你的 GPU 对应架构,以节约运行时编译 PyTorch C++ 扩展的时间: -@REM 'Pascal', '6.0;6.1+PTX' -@REM 'Volta+Tegra', '7.2' -@REM 'Volta', '7.0+PTX' -@REM 'Turing', '7.5+PTX' -@REM 'Ampere+Tegra', '8.7' -@REM 'Ampere', '8.0;8.6+PTX' -@REM 'Ada', '8.9+PTX' -@REM 'Hopper', '9.0+PTX' -set TORCH_CUDA_ARCH_LIST=5.2+PTX;6.0;6.1+PTX;7.5;8.0;8.6;8.9+PTX +@REM 务必根据你的 GPU 型号配置! +set TORCH_CUDA_ARCH_LIST=6.1+PTX @REM 如需配置代理,取消注释(移除行首的 'rem ')并编辑下两行环境变量。 rem set HTTP_PROXY=http://localhost:1081 diff --git "a/pt24-cu121/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/\344\275\277\347\224\250\345\233\275\345\206\205\351\225\234\345\203\217\345\274\272\345\210\266\346\233\264\346\226\260\345\205\250\351\203\250\350\212\202\347\202\271.sh" "b/pt24-cu121/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/\344\275\277\347\224\250\345\233\275\345\206\205\351\225\234\345\203\217\345\274\272\345\210\266\346\233\264\346\226\260\345\205\250\351\203\250\350\212\202\347\202\271.sh" index 5bd7d81..1f93cd3 100644 --- "a/pt24-cu121/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/\344\275\277\347\224\250\345\233\275\345\206\205\351\225\234\345\203\217\345\274\272\345\210\266\346\233\264\346\226\260\345\205\250\351\203\250\350\212\202\347\202\271.sh" +++ "b/pt24-cu121/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/\344\275\277\347\224\250\345\233\275\345\206\205\351\225\234\345\203\217\345\274\272\345\210\266\346\233\264\346\226\260\345\205\250\351\203\250\350\212\202\347\202\271.sh" @@ -23,10 +23,10 @@ function change_url_or_pull () { change_url_or_pull ComfyUI -# 这里使用 & 将任务置入后台,以实现多线程,并等待全部任务完成 +# 这里使用 & 将任务置入后台,以实现多线程(多进程),并等待全部任务完成 cd ./ComfyUI/custom_nodes for D in *; do - if [ -d "${D}" ]; then + if [ -d "${D}" ] && [ "${D}" != "ComfyUI-3D-Pack" ]; then change_url_or_pull "${D}" & fi done diff --git "a/pt24-cu121/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/\351\207\215\346\226\260\347\274\226\350\257\221\345\256\211\350\243\2053D-Pack\344\276\235\350\265\226\351\241\271.bat" "b/pt24-cu121/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/\351\207\215\346\226\260\347\274\226\350\257\221\345\256\211\350\243\2053D-Pack\344\276\235\350\265\226\351\241\271.bat" index 1dcb4c8..f2539a0 100644 --- "a/pt24-cu121/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/\351\207\215\346\226\260\347\274\226\350\257\221\345\256\211\350\243\2053D-Pack\344\276\235\350\265\226\351\241\271.bat" +++ "b/pt24-cu121/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/\351\207\215\346\226\260\347\274\226\350\257\221\345\256\211\350\243\2053D-Pack\344\276\235\350\265\226\351\241\271.bat" @@ -67,6 +67,6 @@ echo "编译完成,开始安装……" del .\tmp_build\numpy-2*.whl -for %i in (.\tmp_build\*.whl) do .\python_embeded\python.exe -s -m pip install --force-reinstall "%i" +for %%i in (.\tmp_build\*.whl) do .\python_embeded\python.exe -s -m pip install --force-reinstall "%%i" .\python_embeded\python.exe -s -m pip install numpy==1.26.4 diff --git a/pt24-cu121/stage2.sh b/pt24-cu121/stage2.sh index 1bc0df3..b9edd00 100644 --- a/pt24-cu121/stage2.sh +++ b/pt24-cu121/stage2.sh @@ -23,7 +23,12 @@ git reset --hard "v0.3.7" # CUSTOM NODES cd "$workdir"/Comfy3D_WinPortable/ComfyUI/custom_nodes +# 3D-Pack mv "$workdir"/ComfyUI-3D-Pack ./ComfyUI-3D-Pack +# Make sure Manager won't update its deps anyway +rm ./ComfyUI-3D-Pack/requirements.txt +rm ./ComfyUI-3D-Pack/install.py +rm -rf ./ComfyUI-3D-Pack/_Pre_Builds # Install ComfyUI-Manager but disable it by default git clone https://ghp.ci/https://github.com/ltdrdata/ComfyUI-Manager.git diff --git a/pt25-cu124/attachments/reinstall-deps-for-3d.bat b/pt25-cu124/attachments/reinstall-deps-for-3d.bat index bf327b5..1855fee 100644 --- a/pt25-cu124/attachments/reinstall-deps-for-3d.bat +++ b/pt25-cu124/attachments/reinstall-deps-for-3d.bat @@ -61,6 +61,6 @@ echo Build complete, installing... del .\tmp_build\numpy-2*.whl -for %i in (.\tmp_build\*.whl) do .\python_embeded\python.exe -s -m pip install --force-reinstall "%i" +for %%i in (.\tmp_build\*.whl) do .\python_embeded\python.exe -s -m pip install --force-reinstall "%%i" .\python_embeded\python.exe -s -m pip install numpy==1.26.4 diff --git "a/pt25-cu124/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/run_cn.bat" "b/pt25-cu124/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/run_cn.bat" index 4e2732b..3b68ce2 100644 --- "a/pt25-cu124/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/run_cn.bat" +++ "b/pt25-cu124/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/run_cn.bat" @@ -1,4 +1,4 @@ -@REM 务必根据 GPU 型号配置! +@REM 务必根据你的 GPU 型号配置! set TORCH_CUDA_ARCH_LIST=6.1+PTX @REM 如需配置代理,取消注释(移除行首的 'rem ')并编辑下两行环境变量。 diff --git "a/pt25-cu124/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/\351\207\215\346\226\260\347\274\226\350\257\221\345\256\211\350\243\2053D-Pack\344\276\235\350\265\226\351\241\271.bat" "b/pt25-cu124/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/\351\207\215\346\226\260\347\274\226\350\257\221\345\256\211\350\243\2053D-Pack\344\276\235\350\265\226\351\241\271.bat" index 49d134f..fd65164 100644 --- "a/pt25-cu124/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/\351\207\215\346\226\260\347\274\226\350\257\221\345\256\211\350\243\2053D-Pack\344\276\235\350\265\226\351\241\271.bat" +++ "b/pt25-cu124/attachments/\344\270\255\346\226\207\350\204\232\346\234\254/\351\207\215\346\226\260\347\274\226\350\257\221\345\256\211\350\243\2053D-Pack\344\276\235\350\265\226\351\241\271.bat" @@ -70,6 +70,6 @@ echo "编译完成,开始安装……" del .\tmp_build\numpy-2*.whl -for %i in (.\tmp_build\*.whl) do .\python_embeded\python.exe -s -m pip install --force-reinstall "%i" +for %%i in (.\tmp_build\*.whl) do .\python_embeded\python.exe -s -m pip install --force-reinstall "%%i" .\python_embeded\python.exe -s -m pip install numpy==1.26.4