MrForExample / ComfyUI-3D-Pack

An extensive node suite that enables ComfyUI to process 3D inputs (Mesh & UV Texture, etc) using cutting edge algorithms (3DGS, NeRF, etc.)
MIT License
2.04k stars 199 forks source link

CharacterGen error #220

Open waomodder opened 1 month ago

waomodder commented 1 month ago

Hello, I have installed ComfyUI-3D-Pack and installed the models in one step, but I am getting an error in CharacterGen. It seems that it is outputting an error related to symbolic links and nvdiffrast_plugin.

image

Operating environment. Windows 11 CUDA 12.1 and 11.8 Pytorch 2.3.0+cu121 workflow CharacterGen_InstantMesh.json

Error log

Error occurred when executing [Comfy3D] Load InstantMesh Reconstruction Model:

DLL load failed while importing nvdiffrast_plugin: 指定されたモジュールが見つかりません。

File "D:\ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\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\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 2275, in load_LRM
lrm_model.init_flexicubes_geometry(DEVICE, fovy=30.0)
File "D:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\InstantMesh\models\lrm_mesh.py", line 79, in init_flexicubes_geometry
renderer = NeuralRender(device, camera_model=camera)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\InstantMesh\models\geometry\render\neural_render.py", line 73, in __init__
self.ctx = dr.RasterizeCudaContext(device=device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\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\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\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1309, in load
return _jit_compile(
^^^^^^^^^^^^^
File "D:\ComfyUI\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1745, in _jit_compile
return _import_module_from_library(name, build_directory, is_python_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 2143, in _import_module_from_library
module = importlib.util.module_from_spec(spec)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 573, in module_from_spec
File "", line 1233, in create_module
File "", line 241, in _call_with_frames_removed
MrForExample commented 1 month ago

Hi @waomodder jit conpile error usually means your pc is missing some cpp libraries and you need to install Visual Studio Build Tools for windows Let me know if that solves your problems :)

waomodder commented 1 month ago

Unfortunately, I have installed all of Workloads: desktop development with C++ and I am getting exactly the same error.


Error occurred when executing [Comfy3D] Load InstantMesh Reconstruction Model:

DLL load failed while importing nvdiffrast_plugin: 指定されたモジュールが見つかりません。

File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\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_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 2275, in load_LRM
lrm_model.init_flexicubes_geometry(DEVICE, fovy=30.0)
File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\InstantMesh\models\lrm_mesh.py", line 79, in init_flexicubes_geometry
renderer = NeuralRender(device, camera_model=camera)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\InstantMesh\models\geometry\render\neural_render.py", line 73, in __init__
self.ctx = dr.RasterizeCudaContext(device=device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\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_windows_portable\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_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1309, in load
return _jit_compile(
^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1745, in _jit_compile
return _import_module_from_library(name, build_directory, is_python_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 2143, in _import_module_from_library
module = importlib.util.module_from_spec(spec)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 573, in module_from_spec
File "", line 1233, in create_module
File "", line 241, in _call_with_frames_removed

image

image

waomodder commented 1 month ago

@MrForExample As a supplement, my GPU is a GeForceRTX3090. The same error regarding 'nvdiffrast_plugin' occurs on the following page. https://github.com/NVlabs/nvdiffrast/issues/46

waomodder commented 1 month ago

@MrForExample One more thing I forgot to mention, my Visual Studio Build Tools 2022 version is 17.10.4. It seems that I need an older version to work with CUDA. I checked and it seems that adding the ‘-allow-unsupported-compiler’ flag to nvcc avoids this error.

https://github.com/nerfstudio-project/nerfstudio/issues/3171

image

pzc163 commented 1 month ago

i have meet same error when import [ComfyUI-3D-Pack] node in comfyui,Do you solve it?

xiaodou29 commented 3 weeks ago

@MrForExample One more thing I forgot to mention, my Visual Studio Build Tools 2022 version is 17.10.4. It seems that I need an older version to work with CUDA.还有一件事我忘了提,我的 Visual Studio 生成工具 2022 版本是 17.10.4。似乎我需要一个旧版本才能与 CUDA 一起使用。 I checked and it seems that adding the ‘-allow-unsupported-compiler’ flag to nvcc avoids this error.我检查了一下,似乎向 nvcc 添加“-allow-unsupported-compiler”标志可以避免此错误。

nerfstudio-project/nerfstudio#3171

image

Hi, it seems i have the same problem as yours, can you explain how to use adding the ‘-allow-unsupported-compiler’ flag to nvcc. I tried to run these codes but they didn't work.

nvcc E:\Aigc\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\nvdiffrast\common\interpolate.cu -o interpolate.cuda.o -allow-unsupported-compiler nvcc E:\Aigc\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\nvdiffrast\common\texture.cu -o texture.cuda.o -allow-unsupported-compiler nvcc E:\Aigc\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\nvdiffrast\common\rasterize.cu -o rasterize.cuda.o -allow-unsupported-compiler nvcc E:\Aigc\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\nvdiffrast\common\antialias.cu -o antialias.cuda.o -allow-unsupported-compiler nvcc E:\Aigc\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\nvdiffrast\common\cudaraster\impl\RasterImpl.cu -o RasterImpl.cuda.o -allow-unsupported-compiler

screenshot-20240802-041403 screenshot-20240802-041517

NeuroLord commented 2 weeks ago

@MrForExample One more thing I forgot to mention, my Visual Studio Build Tools 2022 version is 17.10.4. It seems that I need an older version to work with CUDA.还有一件事我忘了提,我的 Visual Studio 生成工具 2022 版本是 17.10.4。似乎我需要一个旧版本才能与 CUDA 一起使用。 I checked and it seems that adding the ‘-allow-unsupported-compiler’ flag to nvcc avoids this error.我检查了一下,似乎向 nvcc 添加“-allow-unsupported-compiler”标志可以避免此错误。 nerfstudio-project/nerfstudio#3171 image

Hi, it seems i have the same problem as yours, can you explain how to use adding the ‘-allow-unsupported-compiler’ flag to nvcc. I tried to run these codes but they didn't work.

nvcc E:\Aigc\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\nvdiffrast\common\interpolate.cu -o interpolate.cuda.o -allow-unsupported-compiler nvcc E:\Aigc\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\nvdiffrast\common\texture.cu -o texture.cuda.o -allow-unsupported-compiler nvcc E:\Aigc\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\nvdiffrast\common\rasterize.cu -o rasterize.cuda.o -allow-unsupported-compiler nvcc E:\Aigc\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\nvdiffrast\common\antialias.cu -o antialias.cuda.o -allow-unsupported-compiler nvcc E:\Aigc\ComfyUI_Windows_portable\python_embeded\Lib\site-packages\nvdiffrast\common\cudaraster\impl\RasterImpl.cu -o RasterImpl.cuda.o -allow-unsupported-compiler

screenshot-20240802-041403 screenshot-20240802-041517

Have you been able to resolve this? I too am getting an error on the ExplicitTarget Mesh Optimization node (as I can see in the refinement steps). I am resolutely at a loss as to what to do about it.

Error occurred when executing [Comfy3D] ExplicitTarget Mesh Optimization:
CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

Exception raised from c10_cuda_check_implementation at ..\c10\cuda\CUDAException.cpp:43 (most recent call first):
00007FFAECEA366200007FFAECEA3600 c10.dll!c10::Error::Error [ @ ]
00007FFAECEA318A00007FFAECEA3130 c10.dll!c10::detail::torchCheckFail [ @ ]
00007FFB01F6F93F00007FFB01F6F640 c10_cuda.dll!c10::cuda::c10_cuda_check_implementation [ @ ]
00007FFA3124039100007FFA311EF8A0 _C.cp311-win_amd64.pyd!PyInit__C [ @ ]
00007FFA311EBE0700007FFA311D5A60 _C.cp311-win_amd64.pyd!c10::ivalue::Object::operator= [ @ ]
00007FFA311FA36E00007FFA311EF8A0 _C.cp311-win_amd64.pyd!PyInit__C [ @ ]
00007FFA311FA3F400007FFA311EF8A0 _C.cp311-win_amd64.pyd!PyInit__C [ @ ]
00007FFA311E7F9F00007FFA311D5A60 _C.cp311-win_amd64.pyd!c10::ivalue::Object::operator= [ @ ]
00007FFA909A42CC00007FFA909A3550 python311.dll!PyCFunction_GetFlags [ @ ]
00007FFA9095F3D100007FFA9095F2B0 python311.dll!PyObject_MakeTpCall [ @ ]
00007FFA9095F59100007FFA9095F570 python311.dll!PyObject_Vectorcall [ @ ]
00007FFA90A57F1A00007FFA90A53780 python311.dll!PyEval_EvalFrameDefault [ @ ]
00007FFA90A5BD0E00007FFA90A53780 python311.dll!PyEval_EvalFrameDefault [ @ ]
00007FFA9095F76D00007FFA9095F730 python311.dll!PyFunction_Vectorcall [ @ ]
00007FFA9095F50E00007FFA9095F420 python311.dll!PyVectorcall_Function [ @ ]
00007FFA9095F61F00007FFA9095F5D0 python311.dll!PyObject_Call [ @ ]
00007FFA8C53026100007FFA8C51CEA0 torch_python.dll!THPPointer::THPPointer [ @ ]
00007FFA909A430600007FFA909A3550 python311.dll!PyCFunction_GetFlags [ @ ]
00007FFA9095F67800007FFA9095F5D0 python311.dll!PyObject_Call [ @ ]
00007FFA90A5D88400007FFA90A5D320 python311.dll!PyEval_GetFuncDesc [ @ ]
00007FFA90A5903F00007FFA90A53780 python311.dll!PyEval_EvalFrameDefault [ @ ]
00007FFA90A5BD0E00007FFA90A53780 python311.dll!PyEval_EvalFrameDefault [ @ ]
00007FFA9095F76D00007FFA9095F730 python311.dll!PyFunction_Vectorcall [ @ ]
00007FFA90961A3200007FFA90961960 python311.dll!PyMethod_Self [ @ ]
00007FFA9095F4D900007FFA9095F420 python311.dll!PyVectorcall_Function [ @ ]
00007FFA9095F61F00007FFA9095F5D0 python311.dll!PyObject_Call [ @ ]
00007FFA90A5D7BD00007FFA90A5D320 python311.dll!PyEval_GetFuncDesc [ @ ]
00007FFA90A5903F00007FFA90A53780 python311.dll!PyEval_EvalFrameDefault [ @ ]
00007FFA90A5BD0E00007FFA90A53780 python311.dll!PyEval_EvalFrameDefault [ @ ]
00007FFA9095F76D00007FFA9095F730 python311.dll!PyFunction_Vectorcall [ @ ]
00007FFA9095F50E00007FFA9095F420 python311.dll!PyVectorcall_Function [ @ ]
00007FFA9095F61F00007FFA9095F5D0 python311.dll!PyObject_Call [ @ ]
00007FFA90A5D7BD00007FFA90A5D320 python311.dll!PyEval_GetFuncDesc [ @ ]
00007FFA90A5903F00007FFA90A53780 python311.dll!PyEval_EvalFrameDefault [ @ ]
00007FFA90A5BD0E00007FFA90A53780 python311.dll!PyEval_EvalFrameDefault [ @ ]
00007FFA9095F76D00007FFA9095F730 python311.dll!PyFunction_Vectorcall [ @ ]
00007FFA90961AB600007FFA90961960 python311.dll!PyMethod_Self [ @ ]
00007FFA9095F50E00007FFA9095F420 python311.dll!PyVectorcall_Function [ @ ]
00007FFA9095F61F00007FFA9095F5D0 python311.dll!PyObject_Call [ @ ]
00007FFA90908F7E00007FFA90906880 python311.dll!PyOS_SigintEvent [ @ ]
00007FFA90AE0DF200007FFA90AE0B80 python311.dll!PyThread_init_thread [ @ ]
00007FFB2A821BB200007FFB2A821B20 ucrtbase.dll!configthreadlocale [ @ ]
00007FFB2ABC734400007FFB2ABC7330 KERNEL32.DLL!BaseThreadInitThunk [ @ ]
00007FFB2C9026B100007FFB2C902690 ntdll.dll!RtlUserThreadStart [ @ ]

File "K:\Programs\ComfyUI_windows_portable\ComfyUI_windows_non_portable\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "K:\Programs\ComfyUI_windows_portable\ComfyUI_windows_non_portable\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "K:\Programs\ComfyUI_windows_portable\ComfyUI_windows_non_portable\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "K:\Programs\ComfyUI_windows_portable\ComfyUI_windows_non_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 2942, in run_ET_mesh_optimization
vertices, faces = run_mesh_refine(vertices, faces, pil_normal_list, steps=refinement_steps, update_normal_interval=target_update_interval, update_warmup=target_warmup_update_num, )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "K:\Programs\ComfyUI_windows_portable\ComfyUI_windows_non_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\mesh_reconstruction\refine.py", line 53, in run_mesh_refine
_, _, target_normal = from_py3d_mesh(multiview_color_projection(py3d_mesh, pils, cameras_list=cameras, weights=[2.0, 0.8, 1.0, 0.8], confidence_threshold=0.1, complete_unseen=False, below_confidence_strategy='original', reweight_with_cosangle='linear'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "K:\Programs\ComfyUI_windows_portable\ComfyUI_windows_non_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 283, in multiview_color_projection
ret = project_color(meshes, camera, image, eps=eps, resolution=resolution, device=device, use_alpha=use_alpha)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "K:\Programs\ComfyUI_windows_portable\ComfyUI_windows_non_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 134, in project_color
faces_normals = meshes.faces_normals_packed()[unique_faces]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Programs\Anaconda\envs\comfy\Lib\site-packages\pytorch3d\structures\meshes.py", line 800, in faces_normals_packed
self._compute_face_areas_normals()
File "F:\Programs\Anaconda\envs\comfy\Lib\site-packages\pytorch3d\structures\meshes.py", line 868, in _compute_face_areas_normals
face_areas, face_normals = mesh_face_areas_normals(verts_packed, faces_packed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Programs\Anaconda\envs\comfy\Lib\site-packages\torch\autograd\function.py", line 598, in apply
return super().apply(*args, **kwargs) # type: ignore[misc]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Programs\Anaconda\envs\comfy\Lib\site-packages\pytorch3d\ops\mesh_face_areas_normals.py", line 48, in forward
areas, normals = _C.face_areas_normals_forward(verts, faces)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^