diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c8f6d8..53c322c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: # You don't need to cofigure it GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - file: "ComfyUI_Windows_portable_cu121.7z*" + file: "ComfyUI_Windows_portable_cu124.7z*" # always draft before release draft: true overwrite: true diff --git a/attachments/reinstall-deps-for-3d.bat b/attachments/reinstall-deps-for-3d.bat deleted file mode 100644 index d2faf4e..0000000 --- a/attachments/reinstall-deps-for-3d.bat +++ /dev/null @@ -1,60 +0,0 @@ -@echo off -echo ################################################################################ -echo In case you have trouble running 3D-Pack workflow, especially get error from -echo diff_gaussian_rasterization, or just unknown CUDA error: -echo This script is a backup resort, it will attempt to download and build several -echo dependencies for 3D-Pack from GitHub, and will perform an overwrite installation -echo after compiling all the wheel files. -echo It will install packages to local python_embeded folder,and will not affect -echo your Windows OS. -echo If the task is interrupted before the compilation is complete, it will not -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 ################################################################################ -echo Press Enter to continue... - -pause - -@echo on - -@REM In order to save your time on compiling, edit this line according to your GPU arch. -@REM Ref: https://github.com/ashawkey/stable-dreamfusion/issues/360#issuecomment-2292510049 -@REM Ref: https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ -set TORCH_CUDA_ARCH_LIST=5.2+PTX;6.0;6.1+PTX;7.5;8.0;8.6;8.9+PTX - -set CMAKE_ARGS=-DBUILD_opencv_world=ON -DWITH_CUDA=ON -DCUDA_FAST_MATH=ON -DWITH_CUBLAS=ON -DWITH_NVCUVID=ON - -set PATH=%PATH%;%~dp0\python_embeded\Scripts - -if not exist ".\tmp_build" mkdir tmp_build - -.\python_embeded\python.exe -s -m pip install numpy==1.26.4 - -git clone --depth=1 https://github.com/MrForExample/Comfy3D_Pre_Builds.git ^ - .\tmp_build\Comfy3D_Pre_Builds - -.\python_embeded\python.exe -s -m pip wheel -w tmp_build ^ - .\tmp_build\Comfy3D_Pre_Builds\_Libs\pointnet2_ops - -.\python_embeded\python.exe -s -m pip wheel -w tmp_build ^ - .\tmp_build\Comfy3D_Pre_Builds\_Libs\simple-knn - -.\python_embeded\python.exe -s -m pip wheel -w tmp_build ^ - git+https://github.com/ashawkey/diff-gaussian-rasterization.git - -.\python_embeded\python.exe -s -m pip wheel -w tmp_build ^ - git+https://github.com/ashawkey/kiuikit.git - -.\python_embeded\python.exe -s -m pip wheel -w tmp_build ^ - git+https://github.com/NVlabs/nvdiffrast.git - -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" - -.\python_embeded\python.exe -s -m pip install numpy==1.26.4 diff --git a/attachments/run_nvidia_gpu.bat b/attachments/run_nvidia_gpu.bat index 096ace2..2e4d47e 100644 --- a/attachments/run_nvidia_gpu.bat +++ b/attachments/run_nvidia_gpu.bat @@ -21,15 +21,6 @@ set PATH=%PATH%;%~dp0\python_embeded\Scripts @REM 该行命令会使 .pyc 文件集中保存在一处。 set PYTHONPYCACHEPREFIX=%~dp0\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 diff --git "a/attachments/\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/attachments/\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" deleted file mode 100644 index ccd112f..0000000 --- "a/attachments/\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" +++ /dev/null @@ -1,69 +0,0 @@ -chcp 65001 - -@echo off - -echo ################################################################################ -echo "如果遇到 3D-Pack 疑难问题(执行工作流时 C++ 报错、CUDA 报错等," -echo "尤其是 diff_gaussian_rasterization 抛出异常),可以尝试本脚本。" -echo "本脚本会从 GitHub 下载 3D-Pack 的若干依赖项," -echo "并全部编译完后,再使用 wheel 文件进行覆盖安装。" -echo ################################################################################ -echo "运行需要环境: C++ 编译套件 (VS 2022), CUDA 工具包, Git。" -echo "建议修改脚本中的 TORCH_CUDA_ARCH_LIST 以大幅节约编译时间。" -echo ################################################################################ -echo "安装不会影响你的 Windows 系统,只影响 python_embeded 目录。" -echo "如在编译期间中断任务,不会影响 python_embeded 。" -echo "无论执行成功与否,临时文件均会被保留。" -echo ################################################################################ -echo "按回车继续……" - -pause - -@echo on - -@REM 如需配置代理,编辑下两行命令,并取消注释(移除行首的 'rem ')。 -rem set HTTP_PROXY=http://localhost:1081 -rem set HTTPS_PROXY=http://localhost:1081 - -@REM 配置 PIP 与 HuggingFace Hub 镜像 -set PIP_INDEX_URL=https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple -set HF_ENDPOINT=https://hf-mirror.com - -@REM 依照下表,修改为你的 GPU 对应架构,以节约编译时间: -@REM https://github.com/ashawkey/stable-dreamfusion/issues/360#issuecomment-2292510049 -@REM https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ -set TORCH_CUDA_ARCH_LIST=5.2+PTX;6.0;6.1+PTX;7.5;8.0;8.6;8.9+PTX - -set CMAKE_ARGS=-DBUILD_opencv_world=ON -DWITH_CUDA=ON -DCUDA_FAST_MATH=ON -DWITH_CUBLAS=ON -DWITH_NVCUVID=ON - -set PATH=%PATH%;%~dp0\python_embeded\Scripts - -if not exist ".\tmp_build" mkdir tmp_build - -.\python_embeded\python.exe -s -m pip install numpy==1.26.4 - -git clone --depth=1 https://ghp.ci/https://github.com/MrForExample/Comfy3D_Pre_Builds.git ^ - .\tmp_build\Comfy3D_Pre_Builds - -.\python_embeded\python.exe -s -m pip wheel -w tmp_build ^ - .\tmp_build\Comfy3D_Pre_Builds\_Libs\pointnet2_ops - -.\python_embeded\python.exe -s -m pip wheel -w tmp_build ^ - .\tmp_build\Comfy3D_Pre_Builds\_Libs\simple-knn - -.\python_embeded\python.exe -s -m pip wheel -w tmp_build ^ - git+https://ghp.ci/https://github.com/ashawkey/diff-gaussian-rasterization.git - -.\python_embeded\python.exe -s -m pip wheel -w tmp_build ^ - git+https://ghp.ci/https://github.com/ashawkey/kiuikit.git - -.\python_embeded\python.exe -s -m pip wheel -w tmp_build ^ - git+https://ghp.ci/https://github.com/NVlabs/nvdiffrast.git - -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" - -.\python_embeded\python.exe -s -m pip install numpy==1.26.4 diff --git a/generate-requirements.sh b/generate-requirements.sh index 8eeb6cd..efb7acd 100644 --- a/generate-requirements.sh +++ b/generate-requirements.sh @@ -19,12 +19,9 @@ array=( https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/requirements.txt https://raw.githubusercontent.com/crystian/ComfyUI-Crystools/main/requirements.txt https://raw.githubusercontent.com/cubiq/ComfyUI_essentials/main/requirements.txt -https://raw.githubusercontent.com/cubiq/ComfyUI_FaceAnalysis/main/requirements.txt -https://raw.githubusercontent.com/cubiq/ComfyUI_InstantID/main/requirements.txt https://raw.githubusercontent.com/Fannovel16/comfyui_controlnet_aux/main/requirements.txt https://raw.githubusercontent.com/Fannovel16/ComfyUI-Frame-Interpolation/main/requirements-no-cupy.txt https://raw.githubusercontent.com/FizzleDorf/ComfyUI_FizzNodes/main/requirements.txt -https://raw.githubusercontent.com/Gourieff/comfyui-reactor-node/refs/heads/main/requirements.txt https://raw.githubusercontent.com/huchenlei/ComfyUI-layerdiffuse/refs/heads/main/requirements.txt https://raw.githubusercontent.com/jags111/efficiency-nodes-comfyui/main/requirements.txt https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/main/requirements.txt @@ -33,12 +30,7 @@ https://raw.githubusercontent.com/ltdrdata/ComfyUI-Impact-Pack/Main/requirements https://raw.githubusercontent.com/ltdrdata/ComfyUI-Impact-Subpack/main/requirements.txt https://raw.githubusercontent.com/ltdrdata/ComfyUI-Inspire-Pack/main/requirements.txt https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/requirements.txt -https://raw.githubusercontent.com/melMass/comfy_mtb/main/requirements.txt -https://raw.githubusercontent.com/MrForExample/ComfyUI-3D-Pack/main/requirements.txt -https://raw.githubusercontent.com/MrForExample/ComfyUI-AnimateAnyone-Evolved/refs/heads/main/requirements.txt https://raw.githubusercontent.com/storyicon/comfyui_segment_anything/main/requirements.txt -https://raw.githubusercontent.com/WASasquatch/was-node-suite-comfyui/refs/heads/main/requirements.txt -https://raw.githubusercontent.com/ZHO-ZHO-ZHO/ComfyUI-InstantID/main/requirements.txt ) for line in "${array[@]}"; diff --git a/requirements.txt b/requirements.txt index abe68ce..954ac14 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -accelerate addict aiohttp albumentations @@ -17,12 +16,9 @@ filelock ftfy fvcore GitPython -gpytoolbox huggingface-hub -imageio imageio-ffmpeg importlib-metadata -jaxtyping joblib kornia lark @@ -30,45 +26,28 @@ matplotlib matrix-client==0.4.0 mediapipe mss -nerfacc -ninja numba numexpr numpy<2 omegaconf -onnxruntime -open-clip-torch opencv-contrib-python opencv-python opencv-python-headless -packaging pandas -peft piexif pilgram pillow -plyfile psutil py-cpuinfo pygit2 PyGithub -pygltflib -pyhocon -PyMCubes -pymeshlab pynvml python-dateutil python-ffmpeg -pytorch-lightning -pytorch-msssim pyyaml -qrcode[pil] regex rembg -requests -requirements-parser rich -rich-argparse safetensors scikit-image scikit-learn @@ -76,7 +55,6 @@ scipy segment-anything sentencepiece simpleeval -slangtorch soundfile spandrel svglib @@ -87,7 +65,6 @@ torchaudio torchdiffeq torchmetrics torchsde -torchtyping torchvision tqdm transformers @@ -97,6 +74,5 @@ typer typing-extensions ultralytics webcolors -xatlas yacs yapf diff --git a/requirements2.txt b/requirements2.txt index 455cb9f..d2a77af 100644 --- a/requirements2.txt +++ b/requirements2.txt @@ -1,9 +1 @@ -https://github.com/eddiehe99/dlib-whl/releases/download/v19.24.6-alpha/dlib-19.24.6-cp312-cp312-win_amd64.whl -https://raw.githubusercontent.com/Gourieff/Assets/refs/heads/main/Insightface/insightface-0.7.3-cp312-cp312-win_amd64.whl -gradio -gradio-client pixeloe -git+https://github.com/openai/CLIP.git -git+https://github.com/WASasquatch/cstr -git+https://github.com/WASasquatch/ffmpy.git -git+https://github.com/WASasquatch/img2texture.git diff --git a/stage1.sh b/stage1.sh index c08d7df..940625a 100644 --- a/stage1.sh +++ b/stage1.sh @@ -16,18 +16,6 @@ curl https://www.python.org/ftp/python/3.12.7/python-3.12.7-embed-amd64.zip \ -o python_embeded.zip unzip python_embeded.zip -d "$workdir"/python_embeded -# ComfyUI-3D-Pack, part 1/2 -$gcs https://github.com/MrForExample/Comfy3D_Pre_Builds.git \ - "$workdir"/Comfy3D_Pre_Builds - -mv \ - "$workdir"/Comfy3D_Pre_Builds/_Python_Source_cpp/py312/include \ - "$workdir"/python_embeded/include - -mv \ - "$workdir"/Comfy3D_Pre_Builds/_Python_Source_cpp/py312/libs \ - "$workdir"/python_embeded/libs - # Setup Python embeded, part 2/3 cd "$workdir"/python_embeded echo 'import site' >> ./python312._pth @@ -39,8 +27,8 @@ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py --upgrade pip wheel setuptools Cython cmake ./python.exe -s -m pip install \ - xformers==0.0.27.post2 torchvision==0.19.0 torchaudio \ - --index-url https://download.pytorch.org/whl/cu121 \ + xformers torchvision torchaudio \ + --index-url https://download.pytorch.org/whl/cu124 \ --extra-index-url https://pypi.org/simple # 1. requirements.txt @@ -63,22 +51,6 @@ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py ./python.exe -s -m pip install \ mediapipe -# ComfyUI-3D-Pack, part 2/2 -./python.exe -s -m pip install \ - "$workdir"/Comfy3D_Pre_Builds/_Build_Wheels/_Wheels_win_py312_torch2.4.0_cu121/*.whl - -# From: https://github.com/rusty1s/pytorch_scatter?tab=readme-ov-file#binaries -./python.exe -s -m pip install \ - torch-scatter -f https://data.pyg.org/whl/torch-2.4.0%2Bcu121.html - -rm -rf "$workdir"/Comfy3D_Pre_Builds - -# Add Ninja binary (replacing PIP one) -curl -L https://github.com/ninja-build/ninja/releases/latest/download/ninja-win.zip \ - -o ninja-win.zip -unzip -o ninja-win.zip -d "$workdir"/python_embeded/Scripts -rm ninja-win.zip - # Setup Python embeded, part 3/3 sed -i '1i../ComfyUI' ./python312._pth diff --git a/stage2.sh b/stage2.sh index 20fdea9..3f6d242 100644 --- a/stage2.sh +++ b/stage2.sh @@ -15,14 +15,10 @@ mkdir -p "$workdir"/ComfyUI_Windows_portable git clone https://github.com/comfyanonymous/ComfyUI.git \ "$workdir"/ComfyUI_Windows_portable/ComfyUI -# Using stable version (has a release tag) -cd "$workdir"/ComfyUI_Windows_portable/ComfyUI -git reset --hard "$(git tag | grep -e '^v' | sort -V | tail -1)" - # TAESD model for image on-the-fly preview cd "$workdir" $gcs https://github.com/madebyollin/taesd.git -cp taesd/*.pth \ +cp taesd/*_decoder.pth \ "$workdir"/ComfyUI_Windows_portable/ComfyUI/models/vae_approx/ rm -rf taesd @@ -48,11 +44,9 @@ $gcs https://github.com/shiimizu/ComfyUI_smZNodes.git $gcs https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git # Control -$gcs https://github.com/cubiq/ComfyUI_InstantID.git $gcs https://github.com/cubiq/ComfyUI_IPAdapter_plus.git $gcs https://github.com/Fannovel16/comfyui_controlnet_aux.git $gcs https://github.com/florestefano1975/comfyui-portrait-master.git -$gcs https://github.com/Gourieff/comfyui-reactor-node.git $gcs https://github.com/huchenlei/ComfyUI-layerdiffuse.git $gcs https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet.git $gcs https://github.com/ltdrdata/ComfyUI-Inspire-Pack.git @@ -63,18 +57,12 @@ $gcs https://github.com/twri/sdxl_prompt_styler.git # Video $gcs https://github.com/Fannovel16/ComfyUI-Frame-Interpolation.git $gcs https://github.com/FizzleDorf/ComfyUI_FizzNodes.git -$gcs https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved.git $gcs https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git -$gcs https://github.com/melMass/comfy_mtb.git -$gcs https://github.com/MrForExample/ComfyUI-AnimateAnyone-Evolved.git # More -$gcs https://github.com/cubiq/ComfyUI_FaceAnalysis.git -$gcs https://github.com/MrForExample/ComfyUI-3D-Pack.git $gcs https://github.com/pythongosssss/ComfyUI-WD14-Tagger.git $gcs https://github.com/SLAPaper/ComfyUI-Image-Selector.git $gcs https://github.com/ssitu/ComfyUI_UltimateSDUpscale.git -$gcs https://github.com/WASasquatch/was-node-suite-comfyui.git cd "$workdir" @@ -92,15 +80,6 @@ cp "$workdir"/attachments/run_nvidia_gpu.bat \ du -hd1 "$workdir" -# Download models for ReActor -cd "$workdir"/ComfyUI_Windows_portable/ComfyUI/models -curl -L https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/codeformer.pth \ - --create-dirs -o facerestore_models/codeformer-v0.1.0.pth -curl -L https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/GFPGANv1.4.pth \ - --create-dirs -o facerestore_models/GFPGANv1.4.pth -curl -L https://huggingface.co/datasets/Gourieff/ReActor/resolve/main/models/inswapper_128_fp16.onnx \ - --create-dirs -o insightface/inswapper_128_fp16.onnx - # Download Impact-Pack & Subpack & models cd "$workdir"/ComfyUI_Windows_portable/ComfyUI/custom_nodes $gcs https://github.com/ltdrdata/ComfyUI-Impact-Pack.git @@ -113,18 +92,12 @@ $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. #rm -rf "$workdir"/ComfyUI_Windows_portable/python_embeded/Lib/site-packages/pymatting cd "$workdir"/ComfyUI_Windows_portable/ComfyUI/custom_nodes -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 diff --git a/stage3.sh b/stage3.sh index f32c366..7e1632f 100644 --- a/stage3.sh +++ b/stage3.sh @@ -7,6 +7,6 @@ du -hd1 # LZMA2 is ~75% faster than LZMA, but consumes significant 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 +"C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=3 -mfb=32 -md=4m -ms=on -mf=BCJ2 -v2140000000b ComfyUI_Windows_portable_cu124.7z ComfyUI_Windows_portable ls -lahF