diff --git a/comfy3d-pt25/README.adoc b/comfy3d-pt25/README.adoc index 96bbb8e..365e5b0 100644 --- a/comfy3d-pt25/README.adoc +++ b/comfy3d-pt25/README.adoc @@ -155,10 +155,7 @@ podman run -it \ export PATH="$PATH:/root/.local/bin" # Run the compilation script, takes about 10 minutes. -bash /runner-scripts/build-deps.sh - -# Install dependencies -pip install gradio==4.44.1 gradio_litmodel3d==0.0.1 +bash /runner-scripts/build-deps-trellis-demo.sh # Download the model huggingface-cli download JeffreyXiang/TRELLIS-image-large diff --git a/comfy3d-pt25/README.zh.adoc b/comfy3d-pt25/README.zh.adoc index 45765cd..0045254 100644 --- a/comfy3d-pt25/README.zh.adoc +++ b/comfy3d-pt25/README.zh.adoc @@ -163,10 +163,7 @@ podman run -it \ export PATH="$PATH:/root/.local/bin" # 执行一遍编译脚本,耗时10分钟左右 -bash /runner-scripts/build-deps.sh - -# 安装依赖项 -pip install gradio==4.44.1 gradio_litmodel3d==0.0.1 +bash /runner-scripts/build-deps-trellis-demo.sh # 下载模型 huggingface-cli download JeffreyXiang/TRELLIS-image-large diff --git a/comfy3d-pt25/runner-scripts/build-deps-trellis-demo.sh b/comfy3d-pt25/runner-scripts/build-deps-trellis-demo.sh new file mode 100644 index 0000000..f4e3222 --- /dev/null +++ b/comfy3d-pt25/runner-scripts/build-deps-trellis-demo.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +set -eo pipefail + +echo "########################################" +echo "[INFO] Building Dependencies for 3D-Pack..." +echo "########################################" + +cd /root + +if [ -z "${CMAKE_ARGS}" ]; then + export CMAKE_ARGS='-DBUILD_opencv_world=ON -DWITH_CUDA=ON -DCUDA_FAST_MATH=ON -DWITH_CUBLAS=ON -DWITH_NVCUVID=ON' + echo "[INFO] CMAKE_ARGS not set, setting to ${CMAKE_ARGS}" +fi ; + +# Compile PyTorch3D +# Put it first because it takes longest time. +pip install --force-reinstall \ + "git+https://github.com/facebookresearch/pytorch3d.git" + +# Compile libs in Comfy3D_Pre_Builds +aria2c \ + https://github.com/MrForExample/Comfy3D_Pre_Builds/archive/refs/heads/main.zip \ + -d /tmp \ + -o Comfy3D_Pre_Builds-main.zip ; +unzip -q /tmp/Comfy3D_Pre_Builds-main.zip -d /tmp ; +rm /tmp/Comfy3D_Pre_Builds-main.zip ; + +for D in /tmp/Comfy3D_Pre_Builds-main/_Libs/*; do + if [ -d "${D}" ] ; then + pip install --force-reinstall "${D}" + fi +done + +# Compile other deps, using latest +cd /root + +pip install --force-reinstall \ + "git+https://github.com/ashawkey/kiuikit.git" + +pip install --force-reinstall \ + "git+https://github.com/NVlabs/nvdiffrast.git" + +# For TRELLIS +# Note: vox2seq is already included in Comfy3D_Pre_Builds. + +pip install git+https://github.com/JeffreyXiang/diffoctreerast.git + +mkdir -p /tmp/build + +git clone --depth=1 https://github.com/autonomousvision/mip-splatting.git \ + /tmp/build/mip-splatting +#pip uninstall --break-system-packages --yes diff-gaussian-rasterization +pip install --force-reinstall \ + /tmp/build/mip-splatting/submodules/diff-gaussian-rasterization/ + +# (Optional) Compile Flash Attention for Ampere and later GPUs. +# "MAX_JOBS" limits Ninja jobs to avoid OOM. +# If have >96GB RAM, just remove MAX_JOBS line. +export MAX_JOBS=4 +pip install flash-attn --no-build-isolation + +# For TRELLIS demo +pip install gradio==4.44.1 gradio_litmodel3d==0.0.1 + +# Ensure Numpy1 +pip install numpy==1.26.4 + +# Finish +touch /root/.build-complete + +echo "########################################" +echo "[INFO] Build Complete." +echo "########################################" diff --git a/comfy3d-pt25/runner-scripts/build-deps.sh b/comfy3d-pt25/runner-scripts/build-deps.sh index 6541114..0eb5202 100644 --- a/comfy3d-pt25/runner-scripts/build-deps.sh +++ b/comfy3d-pt25/runner-scripts/build-deps.sh @@ -35,8 +35,8 @@ done # Compile other deps, using latest cd /root -# pip install --force-reinstall \ -# "git+https://github.com/ashawkey/diff-gaussian-rasterization.git" +pip install --force-reinstall \ + "git+https://github.com/ashawkey/diff-gaussian-rasterization.git" pip install --force-reinstall \ "git+https://github.com/ashawkey/kiuikit.git" @@ -49,20 +49,6 @@ pip install --force-reinstall \ pip install git+https://github.com/JeffreyXiang/diffoctreerast.git -mkdir -p /tmp/build - -git clone --depth=1 https://github.com/autonomousvision/mip-splatting.git \ - /tmp/build/mip-splatting -#pip uninstall --break-system-packages --yes diff-gaussian-rasterization -pip install --force-reinstall \ - /tmp/build/mip-splatting/submodules/diff-gaussian-rasterization/ - -# (Optional) Compile Flash Attention for Ampere and later GPUs. -# "MAX_JOBS" limits Ninja jobs to avoid OOM. -# If have >96GB RAM, just remove MAX_JOBS line. -export MAX_JOBS=4 -pip install flash-attn --no-build-isolation - # Ensure Numpy1 pip install numpy==1.26.4