comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
57.58k stars 6.1k forks source link

TypeError: MetadataPathFinder.invalidate_caches() missing 1 required positional argument: 'cls' #5382

Open hollywoodeddi3 opened 3 weeks ago

hollywoodeddi3 commented 3 weeks ago

Expected Behavior

I trying to install comfyui on my macbookair m2 keep getting the following error. I attempted uninstalling and reinstalling using miniconda and pip with no luck. anyone experience this problem or have a fix?

Actual Behavior

TypeError: MetadataPathFinder.invalidate_caches() missing 1 required positional argument: 'cls'

Steps to Reproduce

python main.py

Debug Logs

Total VRAM 24576 MB, total RAM 24576 MB
pytorch version: 2.5.0
Set vram state to: SHARED
Device: mps
Traceback (most recent call last):
  File "/Users/hollywoodeddie/Code/ComfyUI/main.py", line 90, in <module>
    import execution
  File "/Users/hollywoodeddie/Code/ComfyUI/execution.py", line 13, in <module>
    import nodes
  File "/Users/hollywoodeddie/Code/ComfyUI/nodes.py", line 21, in <module>
    import comfy.diffusers_load
  File "/Users/hollywoodeddie/Code/ComfyUI/comfy/diffusers_load.py", line 3, in <module>
    import comfy.sd
  File "/Users/hollywoodeddie/Code/ComfyUI/comfy/sd.py", line 8, in <module>
    from .ldm.cascade.stage_c_coder import StageC_coder
  File "/Users/hollywoodeddie/Code/ComfyUI/comfy/ldm/cascade/stage_c_coder.py", line 19, in <module>
    import torchvision
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torchvision/__init__.py", line 10, in <module>
    from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils  # usort:skip
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torchvision/models/__init__.py", line 2, in <module>
    from .convnext import *
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torchvision/models/convnext.py", line 8, in <module>
    from ..ops.misc import Conv2dNormActivation, Permute
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torchvision/ops/__init__.py", line 23, in <module>
    from .poolers import MultiScaleRoIAlign
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torchvision/ops/poolers.py", line 10, in <module>
    from .roi_align import roi_align
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torchvision/ops/roi_align.py", line 7, in <module>
    from torch._dynamo.utils import is_compile_supported
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/__init__.py", line 3, in <module>
    from . import convert_frame, eval_frame, resume_execution
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 53, in <module>
    from . import config, exc, trace_rules
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/trace_rules.py", line 46, in <module>
    from .variables import (
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/variables/__init__.py", line 2, in <module>
    from .builtin import BuiltinVariable
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/variables/builtin.py", line 47, in <module>
    from .ctx_manager import EventVariable, StreamVariable
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/variables/ctx_manager.py", line 22, in <module>
    from .functions import (
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 31, in <module>
    from torch.distributed._composable.fsdp import _fsdp_param_group
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_composable/__init__.py", line 3, in <module>
    from .fully_shard import fully_shard
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_composable/fully_shard.py", line 10, in <module>
    from torch.distributed.fsdp._common_utils import _FSDPState
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/fsdp/__init__.py", line 1, in <module>
    from ._flat_param import FlatParameter as FlatParameter
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/fsdp/_flat_param.py", line 47, in <module>
    from ._fsdp_extensions import (
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/fsdp/_fsdp_extensions.py", line 6, in <module>
    from torch.distributed._shard.sharded_tensor.api import ShardedTensor
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_shard/__init__.py", line 1, in <module>
    from .api import _shard_tensor, load_with_process_group, shard_module, shard_parameter
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_shard/api.py", line 9, in <module>
    from torch.distributed._shard.sharded_tensor import ShardedTensor
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_shard/sharded_tensor/__init__.py", line 8, in <module>
    from .api import (
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_shard/sharded_tensor/api.py", line 31, in <module>
    from .reshard import reshard_local_shard, reshuffle_local_shard
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_shard/sharded_tensor/reshard.py", line 14, in <module>
    from torch.distributed.nn.functional import all_to_all, all_to_all_single
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/nn/__init__.py", line 7, in <module>
    from .api.remote_module import RemoteModule
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/nn/api/remote_module.py", line 42, in <module>
    instantiator.instantiate_non_scriptable_remote_module_template()
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/nn/jit/instantiator.py", line 154, in instantiate_non_scriptable_remote_module_template
    return _do_instantiate_remote_module_template(generated_module_name, str_dict, True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/nn/jit/instantiator.py", line 95, in _do_instantiate_remote_module_template
    importlib.invalidate_caches()
  File "/opt/miniconda3/lib/python3.11/importlib/__init__.py", line 70, in invalidate_caches
    finder.invalidate_caches()
  File "<frozen importlib._bootstrap_external>", line 1409, in invalidate_caches
TypeError: MetadataPathFinder.invalidate_caches() missing 1 required positional argument: 'cls'

Other

No response

ltdrdata commented 3 weeks ago

Have you tried with venv instead of miniconda?