ComfyUI-3D-Pack icon indicating copy to clipboard operation
ComfyUI-3D-Pack copied to clipboard

"ImportError: DLL load failed while importing _C:" "ModuleNotFoundError: No module named 'inference_core_nodes'"

Open gerroon opened this issue 1 year ago β€’ 8 comments

Hi

I am installed it undert WIn 11 ComfyUI, I ran "install_windows_portable_win_py311_cu121.bat" to install the rest afterwards. I am not getting this error, it seem,s like it is not installing properly. I would appreciate if someone can provide me some guidence to fix this since I would love to use this.

 File "c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\nodes.py", line 1879, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\ComfyUI-3D-Pack\__init__.py", line 28, in <module>
    module = importlib.import_module(f".{nodes_filename}", package=__name__)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 53, in <module>
    from .algorithms.dmtet import DMTetMesh
  File "c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\ComfyUI-3D-Pack\algorithms\dmtet.py", line 6, in <module>
    from pytorch3d.loss import chamfer_distance, mesh_laplacian_smoothing
  File "c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\pytorch3d\loss\__init__.py", line 8, in <module>
    from .chamfer import chamfer_distance
  File "c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\pytorch3d\loss\chamfer.py", line 11, in <module>
    from pytorch3d.ops.knn import knn_gather, knn_points
  File "c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\pytorch3d\ops\__init__.py", line 7, in <module>
    from .ball_query import ball_query
  File "c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\pytorch3d\ops\ball_query.py", line 10, in <module>
    from pytorch3d import _C
ImportError: DLL load failed while importing _C: The specified procedure could not be found.

Cannot import c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\ComfyUI-3D-Pack module for custom nodes: DLL load failed while importing _C: The specified procedure could not be found.
Config Export Error[Errno 2] No such file or directory: 'XXXHOST-PATHXXX\\PATH_CFG.json'### Loading: ComfyUI-Impact-Pack (V5.7)
### Loading: ComfyUI-Impact-Pack (Subpack: V0.5)
[Impact Pack] Wildcards loading done.
Traceback (most recent call last):
  File "c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\nodes.py", line 1879, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\ComfyUI-Inference-Core-Nodes\__init__.py", line 1, in <module>
    from inference_core_nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
ModuleNotFoundError: No module named 'inference_core_nodes'

Cannot import c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\ComfyUI-Inference-Core-Nodes module for custom nodes: No module named 'inference_core_nodes'
### Loading: ComfyUI-Inspire-Pack (V0.72.1)
c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\diffusers\models\unet_2d_blocks.py:249: FutureWarning: `AutoencoderTinyBlock` is deprecated and will be removed in version 0.29. Importing `AutoencoderTinyBlock` from `diffusers.models.unet_2d_blocks` is deprecated and this will be removed in a future version. Please use `from diffusers.models.unets.unet_2d_blocks import AutoencoderTinyBlock`, instead.
  deprecate("AutoencoderTinyBlock", "0.29", deprecation_message)
c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\diffusers\models\unet_2d_blocks.py:254: FutureWarning: `UNetMidBlock2D` is deprecated and will be removed in version 0.29. Importing `UNetMidBlock2D` from `diffusers.models.unet_2d_blocks` is deprecated and this will be removed in a future version. Please use `from diffusers.models.unets.unet_2d_blocks import UNetMidBlock2D`, instead.
  deprecate("UNetMidBlock2D", "0.29", deprecation_message)
c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\diffusers\models\unet_2d_blocks.py:259: FutureWarning: `UNetMidBlock2DCrossAttn` is deprecated and will be removed in version 0.29. Importing `UNetMidBlock2DCrossAttn` from `diffusers.models.unet_2d_blocks` is deprecated and this will be removed in a future version. Please use `from diffusers.models.unets.unet_2d_blocks import UNetMidBlock2DCrossAttn`, instead.
  deprecate("UNetMidBlock2DCrossAttn", "0.29", deprecation_message)
c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\diffusers\models\unet_2d_blocks.py:264: FutureWarning: `UNetMidBlock2DSimpleCrossAttn` is deprecated and will be removed in version 0.29. Importing `UNetMidBlock2DSimpleCrossAttn` from `diffusers.models.unet_2d_blocks` is deprecated and this will be removed in a future version. Please use `from diffusers.models.unets.unet_2d_blocks import UNetMidBlock2DSimpleCrossAttn`, instead.
  deprecate("UNetMidBlock2DSimpleCrossAttn", "0.29", deprecation_message)


gerroon avatar Jun 02 '24 02:06 gerroon

@Rachellaw888 thanks, are you saying that I need to have xformers 0.0.25 or 0.0.26 installed?

gerroon avatar Jun 03 '24 03:06 gerroon

I'm also facing this issue too.

midnightrebels avatar Jun 09 '24 14:06 midnightrebels

ImportError: DLL load failed while importing _C: The specified procedure could not be found.

I had this same error in my regular ComfyUI github clone install and it took me ages to track down why. First I made sure to have a consistent set of installs for torch, torchaudio, torchvision and xformers for cuda 12.1 (cu121). I stuck with pytorch 2.1.2 as that was the minimum required version listed in the install section. But I think the latest ComfyUI portable uses a newer version so maybe skip this part. For reference: https://pytorch.org/get-started/previous-versions/

I don't use the portable install, so you'll have to make sure you're running python/pip embedded environment correctly I guess.

pip uninstall pytorch3d pip install git+https://github.com/facebookresearch/pytorch3d.git

Try and run ComfyUI again. If you get more errors in a different script, try uninstalling the offending site-packages and reinstalling them.

I next had an issue with torch-scatter. pip uninstall torch-scatter pip install torch-scatter

Lastly I had an issue with torchmcubes. pip uninstall torchmcubes pip install git+https://github.com/tatsy/torchmcubes.git

Hope that helps.

Moj-X avatar Jun 10 '24 10:06 Moj-X

very good Tanks

shelecx avatar Jun 23 '24 18:06 shelecx

πŸ†— Confirm it works for me, using portable version

  • ❌ torchaudio 2.3.1 / ❌ torchvision 0.18.1 was installed which doesn't works with ❌ torch 2.3.0
  • ❌torch 2.3.1 is not compatible with ❌ xFormers 0.0.26

What we need

  • torchvision 0.18.0
  • torchaudio 2.3.0

For good measures instructions from @Moj-X for python embedded.

python_embeded\python.exe -m pip uninstall pytorch3d
python_embeded\python.exe -m pip install git+https://github.com/facebookresearch/pytorch3d.git
python_embeded\python.exe -m pip uninstall torch-scatter
python_embeded\python.exe -m pip install torch-scatter
python_embeded\python.exe -m pip uninstall torchmcubes
python_embeded\python.exe -m pip install git+https://github.com/tatsy/torchmcubes.git

Additional Steps needed (using portable version with python embedded in root directory)

python_embeded\python.exe -m pip install torchvision 0.18.0 --index-url https://download.pytorch.org/whl/cu121
python_embeded\python.exe -m pip install torchaudio 2.3.0 --index-url https://download.pytorch.org/whl/cu121

Additional Additional steps

python_embeded\python.exe -m pip install rembg
python_embeded\python.exe -m pip install roma

Edit (fix torchvision/torchaudio inverted, add roma, steps in correct order)

sodidos avatar Jun 25 '24 21:06 sodidos

@sodidos do you know your solution might mess up vanilla ComfyUI requirements?

gerroon avatar Jun 26 '24 03:06 gerroon

@sodidos do you know your solution might mess up vanilla ComfyUI requirements?

I haven't found any issues with downgrading from 2.3.1

Moj-X avatar Jul 03 '24 02:07 Moj-X

python_embeded/python.exe -m pip install torchvision 2.3.0 --index-url https://download.pytorch.org/whl/cu121 python_embeded/python.exe -m pip install torchaudio 0.18.0 --index-url https://download.pytorch.org/whl/cu121

Are you sure versions are correct?

packages\pytorch3d\loss\chamfer.py", line 11, in from pytorch3d.ops.knn import knn_gather, knn_points File "c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\pytorch3d\ops_init_.py", line 7, in from .ball_query import ball_query File "c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\pytorch3d\ops\ball_query.py", line 10, in from pytorch3d import _C ImportError: DLL load failed while importing _C: The specified procedure could not be found.

I have the same issue. Python 3.10.11, pytorch version: 2.3.1+cu121. I assume, the issue is pytorch3d WHL but, I can't compile it from source.

S-ed avatar Jul 03 '24 14:07 S-ed

try the new version with cuda 12.8 guys

DenisKochetov avatar Jun 20 '25 08:06 DenisKochetov