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
1.73k stars 167 forks source link

cannot fix ModuleNotFoundError: No module named 'rembg' #116

Open leafar1977 opened 3 months ago

leafar1977 commented 3 months ago

File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 47, in from .tsr.system import TSR File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\tsr\system.py", line 17, in from .utils import ( File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\tsr\utils.py", line 10, in import rembg ModuleNotFoundError: No module named 'rembg'

Cannot import C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack module for custom nodes: No module named 'rembg'

Loading: ComfyUI-Manager (V2.10.2)

ComfyUI Revision: 2072 [40e124c6] | Released on '2024-03-18'

Import times for custom nodes: 0.4 seconds: C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager 1.4 seconds (IMPORT FAILED): C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack

i allways get this error for rembg did the pip install remg - changes nothing

leafar1977 commented 3 months ago

so actually i copyd the rembg from the default python lib/sitepackages into the comfyui lib - same with the onnxruntime that popped up then. now i stuck with

ImportError: DLL load failed while importing onnxruntime_pybind11_state: Das angegebene Modul wurde nicht gefunden.

Cannot import C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack module for custom nodes: DLL load failed while importing onnxruntime_pybind11_state:

kakachiex2 commented 3 months ago

unistall rembg : pip uninstall rembg > pip install rembg the same for onnxruntime most of the time solve those problem good luck.

leafar1977 commented 3 months ago

No didnt work. Anyway , after a while i understood that a regular "pip install xxxx" is just installing site-packages into my default python. started using the \ComfyUI_windows_portable\python_embeded filestrukture - CMD there and then python.exe -m pip install xxmissingmodule
starting the run_nvidia_gpu.bat - checking log whats missing - back to pip install - start bat again ,rince and repeat for quite a while , after two hours i finally got \ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack loaded without any errors. Yay

tryd MVDream_to_Large_Multiview_Gaussian_Model_to_3DGS and_3DMesh.json

got Error occurred when executing [Comfy3D] Load Diffusers Pipeline:

Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\checkpoints\ashawkey/imagedream-ipmv-diffusers\text_encoder.

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\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 "C:\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 "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 1177, in load_diffusers_pipe pipe = diffusers_pipeline_class.from_pretrained( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\huggingface_hub\utils_validators.py", line 118, in _inner_fn return fn(args, kwargs) ^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 819, in from_pretrained loaded_sub_model = load_sub_model( ^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\pipelines\pipeline_loading_utils.py", line 473, in load_sub_model loaded_sub_model = load_method(os.path.join(cached_folder, name), loading_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\transformers\modeling_utils.py", line 3118, in from_pretrained raise EnvironmentError(

then i tryd CRM_Img_to_Multi-views_to_CCMs_to_Mesh.json got

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

DLL load failed while importing nvdiffrast_plugin: Das angegebene Modul wurde nicht gefunden.

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\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 "C:\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 "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 1898, in load_CRM crm_model = CRM(crm_conf).to(device) ^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\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 "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\crm\util\renderer.py", line 15, in init self.glctx = dr.RasterizeCudaContext() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\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 "C:\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 "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1306, in load return _jit_compile( ^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1736, in _jit_compile return _import_module_from_library(name, build_directory, is_python_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 2132, 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

demotivated to try more workflows , started crying :P

leafar1977 commented 3 months ago

image

MrForExample commented 3 months ago

No didnt work. Anyway , after a while i understood that a regular "pip install xxxx" is just installing site-packages into my default python. started using the \ComfyUI_windows_portable\python_embeded filestrukture - CMD there and then python.exe -m pip install xxmissingmodule starting the run_nvidia_gpu.bat - checking log whats missing - back to pip install - start bat again ,rince and repeat for quite a while , after two hours i finally got \ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack loaded without any errors. Yay

tryd MVDream_to_Large_Multiview_Gaussian_Model_to_3DGS and_3DMesh.json

got Error occurred when executing [Comfy3D] Load Diffusers Pipeline:

Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\checkpoints\ashawkey/imagedream-ipmv-diffusers\text_encoder.

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\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 "C:\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 "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 1177, in load_diffusers_pipe pipe = diffusers_pipeline_class.from_pretrained( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\huggingface_hub\utils_validators.py", line 118, in _inner_fn return fn(args, kwargs) ^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 819, in from_pretrained loaded_sub_model = load_sub_model( ^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\pipelines\pipeline_loading_utils.py", line 473, in load_sub_model loaded_sub_model = load_method(os.path.join(cached_folder, name), loading_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\transformers\modeling_utils.py", line 3118, in from_pretrained raise EnvironmentError(

then i tryd CRM_Img_to_Multi-views_to_CCMs_to_Mesh.json got

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

DLL load failed while importing nvdiffrast_plugin: Das angegebene Modul wurde nicht gefunden.

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\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 "C:\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 "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 1898, in load_CRM crm_model = CRM(crm_conf).to(device) ^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\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 "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\crm\util\renderer.py", line 15, in init self.glctx = dr.RasterizeCudaContext() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\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 "C:\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 "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1306, in load return _jit_compile( ^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1736, in _jit_compile return _import_module_from_library(name, build_directory, is_python_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 2132, 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

demotivated to try more workflows , started crying :P

Hi @leafar1977 the first error you got, you can delete your C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-3D-Pack\checkpoints\ashawkey/ folder then model will be downloaded automatically

the second error, make sure you installed VSBuild tool and make sure all the module in requirements_post_win_py3xx_cu121.txt is installed