Open drake7707 opened 1 week ago
torch-scatter needs to be installed with pip install torch-scatter==2.1.2 -f https://data.pyg.org/whl/torch-2.4.0+cu121.html
or it's not pulling the CUDA support.
Also needed diffusers==0.29.0
to prevent errors in _get_model_file
I had a lot of issues getting this pack to work in linux in a docker container,
however after many hours of slow progress I finally got it to work. Here are the changes I needed to make:
1) Don't use prebuilt wheels, it gives errors, I had to build them manually, I'm using "pytorch/pytorch:2.4.0-cuda12.1-cudnn9-devel" as base image
2) Do not use autobuild, it will pull the wrong dependencies for pytorch 2.4.0, I installed
torch-scatter
withpip install torch-scatter==2.1.2 -f https://data.pyg.org/whl/torch-2.4.0+cu121.html
andxformers==0.0.27.post2
through pip and torch-vision was already installed3) I built the diff-gaussian-rasterization, gaussian-splatting -> submodules/simple-knn (had to git clone this one), kiuikit, nvdiffrast and pytorch3d all through their respective
python setup.py install
.4) Don't use OpenGL, I could not get it to work and kept getting eglInitialize() failed errors. So I had to replace all
RasterizeGLContext
withRasterizeCudaContext
5) I had to change the requirements: needed to make sure of
pygltflib==1.16.2
and had to adddataclasses-json
At this point the container started with the 3d pack loaded succesfully
Buuuuut I still had issues in the frontend as well, even on the latest ComfyUI version:
6) The threeVisualiser preview loads in an iframe. For reasons I don't fully understand it tries to import the comfyUI api from window.comfyUI, but this window context is the child window, not the parent window. So I had to patch the comfyUI
scripts/api.js
shim withexport const api = window.comfyAPI?.api?.api || parent.window.comfyAPI?.api?.api;
7) That loaded the node preview without exceptions but threeVisualiser.js uses api.apiURL, which refers to the /api/viewfile and not to the extension path, so I had to patch that:
And
I don't really know what went wrong in the frontend there, but that fixed it for me, I now have a fully working workflow and a preview
Not sure if it will help anyone but I've pushed my image, run it with:
make sure your data folder exist for the bind mount:
I've commited my changes on my fork: https://github.com/drake7707/ComfyUI-3D-Pack/commit/4aa5e86218b10403a7fe9de47cbdfa0731192fbc
So if you pull
https://github.com/drake7707/ComfyUI-3D-Pack.git
into your data/custom_nodes folder, run pip install -r requirements in the container and restart, it should all work