YanWenKun/ComfyUI-Windows-Portable

Load Convolutional Reconstruction Model node Error

rethink-studios opened this issue · 3 comments

After installing cuda 12.4 and Visual, I got this error.
I think it's because the python portable line is hardcoded?
Win11

--- using zero snr---
[Comfy3D] [Load_CRM_MVDiffusion_Model] loaded model ckpt from D:\COMFYUI_BETA_3D\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\checkpoints/crm\ccm-diffusion.pth
DDIM Sampler: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [00:02<00:00, 21.73it/s]
Fatal error in launcher: Unable to create process using '"D:\a\ComfyUI-Windows-Portable\ComfyUI-Windows-Portable\python_embeded\python.exe" "D:\COMFYUI_BETA_3D\ComfyUI\python_embeded\Scripts\ninja.exe" --version': The system cannot find the file specified.

!!! Exception during processing !!!
Traceback (most recent call last):
File "D:\COMFYUI_BETA_3D\ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\COMFYUI_BETA_3D\ComfyUI\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\COMFYUI_BETA_3D\ComfyUI\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\COMFYUI_BETA_3D\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 1910, in load_CRM
crm_model = CRM(crm_conf).to(device)
^^^^^^^^^^^^^
File "D:\COMFYUI_BETA_3D\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\crm\model\crm\model.py", line 59, in init
self.renderer = Renderer(tet_grid_size=self.tet_grid_size, camera_angle_num=self.camera_angle_num,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\COMFYUI_BETA_3D\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\crm\util\renderer.py", line 15, in init
self.glctx = dr.RasterizeCudaContext()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\COMFYUI_BETA_3D\ComfyUI\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 177, in init
self.cpp_wrapper = _get_plugin().RasterizeCRStateWrapper(cuda_device_idx)
^^^^^^^^^^^^^
File "D:\COMFYUI_BETA_3D\ComfyUI\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 118, in _get_plugin
torch.utils.cpp_extension.load(name=plugin_name, sources=source_paths, extra_cflags=opts, extra_cuda_cflags=opts+['-lineinfo'], extra_ldflags=ldflags, with_cuda=True, verbose=False)
File "D:\COMFYUI_BETA_3D\ComfyUI\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1306, in load
return _jit_compile(
^^^^^^^^^^^^^
File "D:\COMFYUI_BETA_3D\ComfyUI\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1710, in _jit_compile
_write_ninja_file_and_build_library(
File "D:\COMFYUI_BETA_3D\ComfyUI\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1793, in _write_ninja_file_and_build_library
verify_ninja_availability()
File "D:\COMFYUI_BETA_3D\ComfyUI\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1842, in verify_ninja_availability
raise RuntimeError("Ninja is required to load C++ extensions")
RuntimeError: Ninja is required to load C++ extensions

Prompt executed in 29.17 seconds

Fatal error in launcher: Unable to create process using '"D:\a\ComfyUI-Windows-Portable\ComfyUI-Windows-Portable\python_embeded\python.exe" "D:\ComfyUI_Windows_portable\ComfyUI\python_embeded\Scripts\ninja.exe" --version': The system cannot find the file specified.

Shouldn't the path look like this with double slashes?
D:\ComfyUI_Windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack

Or is there a way to remove the "a" from D:\a\ComfyUI??

I was able to make it work by adding the path to ninja.exe in my environment variable: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja. It should probably work as well with the ninja in the embedded python. I tried to add it in python311._pth but it did not work.

Sorry for being late!

I have updated the package and added the Ninja official binary (replacing PIP's wrapper one, which I guess something went wrong). Hope it can solve the issue.

Just make sure you have this line in run_nvidia_gpu.bat before ComfyUI starts:
(Modify C:\EDIT_THIS_TO_PATH_TO_YOUR_\ to your folder)

set PATH=%PATH%;C:\EDIT_THIS_TO_PATH_TO_YOUR_\python_embeded\Scripts\

If you don't want to download the whole package again, just download the Ninja binary, extract it to python_embeded/Scripts, and replace the ninja.exe.