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.7k stars 164 forks source link

Cannot import ComfyUI-3D-Pack module for custom nodes: Cannot subclass _TensorBase directly #172

Open unclemusclez opened 1 week ago

unclemusclez commented 1 week ago

ComfyUI on WSL2 with ROCm

Traceback (most recent call last):
  File "/home/musclez/ComfyUI/nodes.py", line 1906, 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 "/home/musclez/ComfyUI/custom_nodes/ComfyUI-3D-Pack/__init__.py", line 28, in <module>
    module = importlib.import_module(f".{nodes_filename}", package=__name__)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, 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 "/home/musclez/ComfyUI/custom_nodes/ComfyUI-3D-Pack/nodes.py", line 48, in <module>
    from .algorithms.main_3DGS import GaussianSplatting, GaussianSplattingCameraController, GSParams
  File "/home/musclez/ComfyUI/custom_nodes/ComfyUI-3D-Pack/algorithms/main_3DGS.py", line 11, in <module>
    from .main_3DGS_renderer import GaussianSplattingRenderer
  File "/home/musclez/ComfyUI/custom_nodes/ComfyUI-3D-Pack/algorithms/main_3DGS_renderer.py", line 6, in <module>
    import torchtyping.TensorType as TensorType
  File "/home/musclez/ComfyUI/.venv/lib/python3.11/site-packages/torchtyping/__init__.py", line 10, in <module>
    from .tensor_type import TensorType
  File "/home/musclez/ComfyUI/.venv/lib/python3.11/site-packages/torchtyping/tensor_type.py", line 37, in <module>
    class TensorTypeMixin(metaclass=_TensorTypeMeta):
RuntimeError: Cannot subclass _TensorBase directly

Cannot import /home/musclez/ComfyUI/custom_nodes/ComfyUI-3D-Pack module for custom nodes: Cannot subclass _TensorBase directly
meanmee commented 5 days ago

same here

[START] Security scan [DONE] Security scan

ComfyUI-Manager: installing dependencies done.

ComfyUI startup time: 2024-06-25 12:52:59.377751 Platform: Linux Python version: 3.12.3 | packaged by Anaconda, Inc. | (main, May 6 2024, 19:46:43) [GCC 11.2.0] Python executable: /root/miniconda3/bin/python ** Log path: /home/wuxm/code/ComfyUI/comfyui.log

Prestartup times for custom nodes: 0.3 seconds: /home/wuxm/code/ComfyUI/custom_nodes/ComfyUI-Manager

Total VRAM 16039 MB, total RAM 31916 MB pytorch version: 2.5.0.dev20240623+cu124 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 4080 SUPER : cudaMallocAsync Using pytorch cross attention /root/miniconda3/lib/python3.12/site-packages/kornia/feature/lightglue.py:44: FutureWarning: torch.cuda.amp.custom_fwd(args...) is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda') instead. @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)

Loading: ComfyUI-Manager (V2.41)

ComfyUI Revision: 2280 [73ca7800] | Released on '2024-06-23'

/root/miniconda3/lib/python3.12/site-packages/diffusers/models/transformers/transformer_2d.py:34: FutureWarning: Transformer2DModelOutput is deprecated and will be removed in version 1.0.0. Importing Transformer2DModelOutput from diffusers.models.transformer_2d is deprecated and this will be removed in a future version. Please use from diffusers.models.modeling_outputs import Transformer2DModelOutput, instead. deprecate("Transformer2DModelOutput", "1.0.0", deprecation_message)

[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json Traceback (most recent call last): File "/home/wuxm/code/ComfyUI/nodes.py", line 1906, in load_custom_node module_spec.loader.exec_module(module) File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/home/wuxm/code/ComfyUI/custom_nodes/ComfyUI-3D-Pack/init.py", line 44, in module = importlib.import_module(f".{nodes_filename}", package=name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/home/wuxm/code/ComfyUI/custom_nodes/ComfyUI-3D-Pack/nodes.py", line 48, in from .algorithms.main_3DGS import GaussianSplatting, GaussianSplattingCameraController, GSParams File "/home/wuxm/code/ComfyUI/custom_nodes/ComfyUI-3D-Pack/algorithms/main_3DGS.py", line 11, in from .main_3DGS_renderer import GaussianSplattingRenderer File "/home/wuxm/code/ComfyUI/custom_nodes/ComfyUI-3D-Pack/algorithms/main_3DGS_renderer.py", line 6, in from torchtyping import TensorType File "/root/miniconda3/lib/python3.12/site-packages/torchtyping/init.py", line 10, in from .tensor_type import TensorType File "/root/miniconda3/lib/python3.12/site-packages/torchtyping/tensor_type.py", line 37, in class TensorTypeMixin(metaclass=_TensorTypeMeta): RuntimeError: Cannot subclass _TensorBase directly

Cannot import /home/wuxm/code/ComfyUI/custom_nodes/ComfyUI-3D-Pack module for custom nodes: Cannot subclass _TensorBase directly Total VRAM 16039 MB, total RAM 31916 MB pytorch version: 2.5.0.dev20240623+cu124 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 4080 SUPER : cudaMallocAsync

Import times for custom nodes: 0.0 seconds: /home/wuxm/code/ComfyUI/custom_nodes/websocket_image_save.py 0.0 seconds: /home/wuxm/code/ComfyUI/custom_nodes/ComfyUI_IPAdapter_plus 0.0 seconds: /home/wuxm/code/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved 0.0 seconds: /home/wuxm/code/ComfyUI/custom_nodes/ComfyUI-Manager 0.0 seconds: /home/wuxm/code/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite 0.1 seconds: /home/wuxm/code/ComfyUI/custom_nodes/ComfyUI-KJNodes 0.4 seconds (IMPORT FAILED): /home/wuxm/code/ComfyUI/custom_nodes/ComfyUI-3D-Pack

Starting server

To see the GUI go to: http://172.17.0.2:8188 FETCH DATA from: /home/wuxm/code/ComfyUI/custom_nodes/ComfyUI-Manager/extension-node-map.json [DONE]

unclemusclez commented 4 days ago

any update?

unclemusclez commented 4 days ago

@meanmee you may need to compile https://github.com/graphdeco-inria/gaussian-splatting submodule https://github.com/graphdeco-inria/diff-gaussian-rasterization/tree/59f5f77e3ddbac3ed9db93ec2cfe99ed6c5d121d

i'm having this same issue but i'm on the ROCm platform, and currently https://github.com/ROCm/HIP-CPU/issues/60 may be related