storyicon/comfyui_segment_anything

Cannot import /root/ComfyUI/custom_nodes/comfyui_segment_anything module for custom nodes: A Message class can only inherit from Message

shawpook opened this issue · 3 comments

Traceback (most recent call last):
File "/root/ComfyUI/nodes.py", line 1735, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/root/ComfyUI/custom_nodes/comfyui_segment_anything/init.py", line 1, in
from .node import *
File "/root/ComfyUI/custom_nodes/comfyui_segment_anything/node.py", line 17, in
from sam_hq.build_sam_hq import sam_model_registry
File "/root/ComfyUI/custom_nodes/comfyui_segment_anything/sam_hq/build_sam_hq.py", line 13, in
from .modeling.tiny_vit import TinyViT
File "/root/ComfyUI/custom_nodes/comfyui_segment_anything/sam_hq/modeling/tiny_vit.py", line 15, in
from timm.models.layers import DropPath as TimmDropPath,
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/timm/init.py", line 3, in
from .models import create_model, list_models, list_pretrained, is_model, list_modules, model_entrypoint,
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/timm/models/init.py", line 1, in
from .beit import *
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/timm/models/beit.py", line 49, in
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/timm/data/init.py", line 5, in
from .dataset import ImageDataset, IterableImageDataset, AugMixDataset
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/timm/data/dataset.py", line 13, in
from .readers import create_reader
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/timm/data/readers/init.py", line 1, in
from .reader_factory import create_reader
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/timm/data/readers/reader_factory.py", line 3, in
from .reader_image_folder import ReaderImageFolder
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/timm/data/readers/reader_image_folder.py", line 11, in
from timm.utils.misc import natural_key
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/timm/utils/init.py", line 15, in
from .summary import update_summary, get_outdir
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/timm/utils/summary.py", line 9, in
import wandb
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/wandb/init.py", line 27, in
from wandb import sdk as wandb_sdk
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/wandb/sdk/init.py", line 4, in
from .artifacts.artifact import Artifact # noqa: F401
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/wandb/sdk/artifacts/artifact.py", line 36, in
from wandb.apis.normalize import normalize_exceptions
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/wandb/apis/init.py", line 43, in
from .internal import Api as InternalApi # noqa
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/wandb/apis/internal.py", line 3, in
from wandb.sdk.internal.internal_api import Api as InternalApi
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/wandb/sdk/internal/internal_api.py", line 48, in
from ..lib import retry
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/wandb/sdk/lib/retry.py", line 17, in
from .mailbox import ContextCancelledError
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/wandb/sdk/lib/mailbox.py", line 10, in
from wandb.proto import wandb_internal_pb2 as pb
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/wandb/proto/wandb_internal_pb2.py", line 6, in
from wandb.proto.v3.wandb_internal_pb2 import *
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/wandb/proto/v3/wandb_internal_pb2.py", line 15, in
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/google/protobuf/timestamp_pb2.py", line 19, in
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.timestamp_pb2', globals())
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/google/protobuf/internal/builder.py", line 108, in BuildTopDescriptorsAndMessages
module[name] = BuildMessage(msg_des)
File "/root/.local/conda/envs/com/lib/python3.10/site-packages/google/protobuf/internal/builder.py", line 85, in BuildMessage
message_class = _reflection.GeneratedProtocolMessageType(
TypeError: A Message class can only inherit from Message

Cannot import /root/ComfyUI/custom_nodes/comfyui_segment_anything module for custom nodes: A Message class can only inherit from Message
Searge-SDXL v4.0 in /root/ComfyUI/custom_nodes/SeargeSDXL

Other nodes have also reported this issue, but no solution has been found

I have encountered similar problems before, which may solve your problem: ssitu/ComfyUI_roop#1 (comment)

@shawpook

我以前遇到过类似的问题,可能会解决你的问题:ssitu/ComfyUI_roop#1(评论)

@shawpook

Success, thank you!

I'm glad to hear that. If you have any other questions, feel free to raise new issues.