Skip to content

Commit

Permalink
pt21 first build
Browse files Browse the repository at this point in the history
  • Loading branch information
YanWenKun committed Dec 11, 2024
1 parent 8aeabe7 commit 1862bff
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 26 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build-pt21-cu118.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Build & Upload pt21-cu118 Package"

on:
workflow_dispatch:

jobs:
build_upload:
permissions:
contents: "write"
packages: "write"
pull-requests: "read"
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Stage 1 Gathering Dependencies
shell: bash
working-directory: pt21-cu118
run: bash stage1.sh

- name: Stage 2 Assembling Repositories
shell: bash
working-directory: pt21-cu118
run: bash stage2.sh

- name: Stage 3 Compressing Package
shell: bash
working-directory: pt21-cu118
run: bash stage3.sh

- name: Upload archive to release
uses: xresloader/upload-to-github-release@v1
env:
# You don't need to configure this token. It'll be auto-set when GitHub Actions start.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "pt21-cu118/Comfy3D_WinPortable.7z*"
# Always draft before release.
draft: true
overwrite: true
22 changes: 18 additions & 4 deletions pt21-cu118/attachments/!FIRST_RUN-compile-install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,34 @@ set TORCH_CUDA_ARCH_LIST=6.1+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

.\python_embeded\python.exe -s -m pip install --force-reinstall ^
.\python_embeded\python.exe -s -m pip install ^
"git+https://github.com/facebookresearch/[email protected]"

@REM Compile-install pointnet2_ops for Triplane Gaussian

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

@REM Compile-install diff-gaussian-rasterization for Triplane Gaussian

.\python_embeded\python.exe -s -m pip install --force-reinstall ^
.\python_embeded\python.exe -s -m pip install ^
"git+https://github.com/ashawkey/diff-gaussian-rasterization.git"

@REM Compile-install simple-knn

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

@REM Compile-install kiuikit

.\python_embeded\python.exe -s -m pip install ^
git+https://github.com/ashawkey/kiuikit.git

@REM Compile-install nvdiffrast

.\python_embeded\python.exe -s -m pip install ^
git+https://github.com/NVlabs/nvdiffrast.git

@REM Ensure numpy1

.\python_embeded\python.exe -s -m pip install numpy==1.26.4
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,34 @@ set PATH=%PATH%;%~dp0\python_embeded\Scripts

set PIP_INDEX_URL=https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

.\python_embeded\python.exe -s -m pip install --force-reinstall ^
.\python_embeded\python.exe -s -m pip install ^
"git+https://ghp.ci/https://github.com/facebookresearch/[email protected]"

@REM 编译安装 pointnet2_ops ,该组件用于 Triplane Gaussian

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

@REM 编译安装 diff-gaussian-rasterization ,该组件用于 Triplane Gaussian

.\python_embeded\python.exe -s -m pip install --force-reinstall ^
.\python_embeded\python.exe -s -m pip install ^
"git+https://ghp.ci/https://github.com/ashawkey/diff-gaussian-rasterization.git"

@REM 编译安装 simple-knn

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

@REM 编译安装 kiuikit

.\python_embeded\python.exe -s -m pip install ^
git+https://github.com/ashawkey/kiuikit.git

@REM 编译安装 nvdiffrast

.\python_embeded\python.exe -s -m pip install ^
git+https://github.com/NVlabs/nvdiffrast.git

@REM 保证使用 numpy1

.\python_embeded\python.exe -s -m pip install numpy==1.26.4
10 changes: 5 additions & 5 deletions pt21-cu118/requirements3.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--index-url https://download.pytorch.org/whl/cu121
--index-url https://download.pytorch.org/whl/cu118
--extra-index-url https://pypi.org/simple
xformers==0.0.27.post2
torch==2.4.0
torchvision==0.19.0
torchaudio==2.4.0
xformers==0.0.23.post1
torch==2.1.2
torchvision==0.16.2
torchaudio==2.1.2
1 change: 1 addition & 0 deletions pt21-cu118/requirements5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ torchtyping
trimesh
typer
typing-extensions
ultralytics
webcolors
xatlas
6 changes: 1 addition & 5 deletions pt21-cu118/requirements9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ matrix-client==0.4.0
# Fix for CRM V1
open-clip-torch==2.24.0

# For CRM V3 (eden_comfy_pipelines)
# open-clip-torch==2.26.1

# Forcing version to prevent PIP re-installing
clip-interrogator==0.6.0
ultralytics==8.2.70
diffusers==0.29.1
torchvision==0.19.0
torchvision==0.16.2
14 changes: 6 additions & 8 deletions pt21-cu118/stage1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ls -lahF

# Download Python embeded
cd "$workdir"
curl -sSL https://github.com/adang1345/PythonWindows/raw/refs/heads/master/3.11.11/python-3.11.11-embed-amd64.zip \
curl -sSL https://github.com/adang1345/PythonWindows/raw/refs/heads/master/3.10.16/python-3.10.16-embed-amd64.zip \
-o python_embeded.zip
unzip -q python_embeded.zip -d "$workdir"/python_embeded

Expand All @@ -37,16 +37,16 @@ rm Comfy3D_Pre_Builds-d11afaad1944278712f13865f0bb902a5fd9c745.zip
# Header files for ComfyUI-3D-Pack
# Do this firstly (in a clean python_embeded folder)
mv \
"$workdir"/Comfy3D_Pre_Builds/_Python_Source_cpp/py311/include \
"$workdir"/Comfy3D_Pre_Builds/_Python_Source_cpp/py310/include \
"$workdir"/python_embeded/include

mv \
"$workdir"/Comfy3D_Pre_Builds/_Python_Source_cpp/py311/libs \
"$workdir"/Comfy3D_Pre_Builds/_Python_Source_cpp/py310/libs \
"$workdir"/python_embeded/libs

# Setup PIP
cd "$workdir"/python_embeded
sed -i 's/^#import site/import site/' ./python311._pth
sed -i 's/^#import site/import site/' ./python310._pth
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
./python.exe get-pip.py

Expand All @@ -59,10 +59,8 @@ $pip_exe install -r "$workdir"/requirements4.txt
$pip_exe install -r "$workdir"/requirements5.txt
$pip_exe install -r "$workdir"/requirements6.txt

$pip_exe install "$workdir"/Comfy3D_Pre_Builds/_Build_Wheels/_Wheels_win_py311_torch2.4.0_cu121/*.whl

# From: https://github.com/rusty1s/pytorch_scatter?tab=readme-ov-file#binaries
$pip_exe install torch-scatter -f https://data.pyg.org/whl/torch-2.4.0%2Bcu121.html
$pip_exe install torch-scatter -f https://data.pyg.org/whl/torch-2.1.2%2Bcu118.html

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

Expand All @@ -87,7 +85,7 @@ rm aria2.zip

# Setup Python embeded, part 3/3
cd "$workdir"/python_embeded
sed -i '1i../ComfyUI' ./python311._pth
sed -i '1i../ComfyUI' ./python310._pth

$pip_exe list

Expand Down

0 comments on commit 1862bff

Please sign in to comment.