Skip to content

Commit

Permalink
(WIP) attemp to build pt25 with TRELLIS
Browse files Browse the repository at this point in the history
  • Loading branch information
YanWenKun committed Dec 18, 2024
1 parent 640a5a2 commit b53c5bf
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 21 deletions.
6 changes: 4 additions & 2 deletions pt25-cu124/README.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
This build is working, but not released yet.
How to build:

If you need, simply fork this repo and go to "Actions" page, then you can build it using GitHub Actions.
1. Fork this repo on GitHub
2. Run the build operations in "Actions" page
3. Download the artifact in "Releases" page
9 changes: 9 additions & 0 deletions pt25-cu124/attachments/!FIRST_RUN-compile-install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
@REM You don't need to add the "+PTX". Here it works as a fail-safe (providing forward compatibility).
set TORCH_CUDA_ARCH_LIST=6.1+PTX

@REM ===========================================================================

@REM Compile-install PyTorch3D
@REM PyTorch3D on Windows works best through compile-install. Binary-install will fail on some workflows.
@REM e.g. "CUDA error: no kernel image is available for execution on the device"
Expand Down Expand Up @@ -31,3 +33,10 @@ set PATH=%PATH%;%~dp0\python_embeded\Scripts

.\python_embeded\python.exe -s -m pip install --force-reinstall ^
.\extras\vox2seq

@REM Compile-install Flash Attention for TRELLIS
@REM flash-attn can ONLY be used on Ampere and later GPUs (RTX 30 series and beyond)
@REM Safe to remove this if you are not using RTX 30/40 or A100+.

.\python_embeded\python.exe -s -m pip install ^
flash-attn
1 change: 0 additions & 1 deletion pt25-cu124/requirements4.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ aiohttp
diffusers
einops
fairscale
flash-attn
ftfy
huggingface-hub[hf-transfer]
imageio
Expand Down
4 changes: 0 additions & 4 deletions pt25-cu124/requirements7.txt

This file was deleted.

6 changes: 4 additions & 2 deletions pt25-cu124/requirements8.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
--find-links https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.5.1_cu124.html
kaolin
# https://pip.pypa.io/en/stable/reference/requirements-file-format/
# https://github.com/rusty1s/pytorch_scatter?tab=readme-ov-file#binaries
--find-links https://data.pyg.org/whl/torch-2.5.1%2Bcu124.html
torch-scatter
2 changes: 2 additions & 0 deletions pt25-cu124/requirements9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--find-links https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.5.1_cu124.html
kaolin
4 changes: 4 additions & 0 deletions pt25-cu124/requirementsA.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ numpy==1.26.4

# For ComfyUI-Manager
matrix-client==0.4.0

# For TRELLIS demo
gradio==4.44.1
gradio_litmodel3d==0.0.1
14 changes: 7 additions & 7 deletions pt25-cu124/stage1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ mv ComfyUI-3D-Pack-0880fa8d2945b8abb990ad768e0cfe704e0d025e ComfyUI-3D-Pack
rm ComfyUI-3D-Pack-0880fa8d2945b8abb990ad768e0cfe704e0d025e.zip

cd "$workdir"
curl -sSL https://github.com/MrForExample/Comfy3D_Pre_Builds/archive/606a5cf09aef1ecaf0092f6b645ac46bc2772d86.zip \
-o Comfy3D_Pre_Builds-606a5cf09aef1ecaf0092f6b645ac46bc2772d86.zip
unzip -q Comfy3D_Pre_Builds-606a5cf09aef1ecaf0092f6b645ac46bc2772d86.zip
mv Comfy3D_Pre_Builds-606a5cf09aef1ecaf0092f6b645ac46bc2772d86 Comfy3D_Pre_Builds
rm Comfy3D_Pre_Builds-606a5cf09aef1ecaf0092f6b645ac46bc2772d86.zip
curl -sSL https://github.com/MrForExample/Comfy3D_Pre_Builds/archive/ac9f238f092b94ba319ce06f3ccd80b9d0f6c8c4.zip \
-o Comfy3D_Pre_Builds-ac9f238f092b94ba319ce06f3ccd80b9d0f6c8c4.zip
unzip -q Comfy3D_Pre_Builds-ac9f238f092b94ba319ce06f3ccd80b9d0f6c8c4.zip
mv Comfy3D_Pre_Builds-ac9f238f092b94ba319ce06f3ccd80b9d0f6c8c4 Comfy3D_Pre_Builds
rm Comfy3D_Pre_Builds-ac9f238f092b94ba319ce06f3ccd80b9d0f6c8c4.zip

# Header files for ComfyUI-3D-Pack
# Do this firstly (in a clean python_embeded folder)
Expand All @@ -58,12 +58,12 @@ $pip_exe install -r "$workdir"/requirements3.txt
$pip_exe install -r "$workdir"/requirements4.txt
$pip_exe install -r "$workdir"/requirements5.txt
$pip_exe install -r "$workdir"/requirements6.txt
$pip_exe install -r "$workdir"/requirements7.txt
$pip_exe install -r "$workdir"/requirements8.txt

rm "$workdir"/Comfy3D_Pre_Builds/_Build_Wheels/_Wheels_win_py312_torch2.5.1_cu124/torch_scatter-2.1.2-cp312-cp312-win_amd64.whl
$pip_exe install "$workdir"/Comfy3D_Pre_Builds/_Build_Wheels/_Wheels_win_py312_torch2.5.1_cu124/*.whl

$pip_exe install -r "$workdir"/requirements8.txt
$pip_exe install -r "$workdir"/requirements9.txt
$pip_exe install -r "$workdir"/requirementsA.txt

# Add Ninja binary (replacing PIP Ninja)
Expand Down
28 changes: 23 additions & 5 deletions pt25-cu124/stage2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ mkdir -p "$workdir"/Comfy3D_WinPortable
export HF_HUB_CACHE="$workdir/Comfy3D_WinPortable/HuggingFaceHub"
mkdir -p "$HF_HUB_CACHE"

# ComfyUI main app
# ComfyUI main app (latest)
git clone https://github.com/comfyanonymous/ComfyUI.git \
"$workdir"/Comfy3D_WinPortable/ComfyUI
cd "$workdir"/Comfy3D_WinPortable/ComfyUI
git reset --hard "v0.3.7"

# CUSTOM NODES
cd "$workdir"/Comfy3D_WinPortable/ComfyUI/custom_nodes
Expand All @@ -30,8 +28,8 @@ 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
# Not this time
# ComfyUI-Manager
# This time not disable it
$gcs https://github.com/ltdrdata/ComfyUI-Manager.git
# mv ComfyUI-Manager ComfyUI-Manager.disabled

Expand Down Expand Up @@ -87,6 +85,26 @@ mv "$workdir"/Comfy3D_WinPortable/ComfyUI/custom_nodes/ComfyUI-3D-Pack/_Example_
# Move source files needed by user compile-install
mv "$workdir"/Comfy3D_Pre_Builds/_Libs/* "$workdir"/Comfy3D_WinPortable/extras/

# Download more source repos
cd "$workdir"/Comfy3D_WinPortable/extras/

curl -sSL https://github.com/EasternJournalist/utils3d/archive/refs/heads/main.zip \
-o temp.zip
unzip -q temp.zip
mv utils3d-main utils3d
rm temp.zip


cd "$workdir"/Comfy3D_WinPortable/extras/

curl -sSL https://github.com/autonomousvision/mip-splatting.git \
-o temp.zip
unzip -q temp.zip
mv TRELLIS-main TRELLIS
rm temp.zip



# Copy & overwrite attachments
cp -rf "$workdir"/attachments/* \
"$workdir"/Comfy3D_WinPortable/
Expand Down

0 comments on commit b53c5bf

Please sign in to comment.