Skip to content

ModuleNotFoundError on ComfyUI v0.8+: hardcoded custom_nodes. prefix in py/defs/__init__.py breaks loading #102

@sunkai174634

Description

@sunkai174634

Bug Description

Extension fails to load on ComfyUI v0.8+ with:

ModuleNotFoundError: No module named 'custom_nodes.ComfyUI-SaveImageWithMetaData'

Root Cause

In py/defs/__init__.py, line 16, the module path is constructed with a hardcoded custom_nodes. prefix:

package_name = f"custom_nodes.ComfyUI-SaveImageWithMetaData.py.defs.ext.{module_name}"

This worked on older ComfyUI versions where the custom node root was implicitly custom_nodes/. In ComfyUI v0.8+, the module root is no longer prefixed with custom_nodes., causing importlib.import_module(package_name) to fail.

Fix

Remove the custom_nodes. prefix:

package_name = f"ComfyUI-SaveImageWithMetaData.py.defs.ext.{module_name}"

Environment

  • ComfyUI v0.8.36 (bundled with ComfyUI Desktop on macOS)
  • ComfyUI-SaveImageWithMetaData latest (cloned from git)

Reproduction

  1. Clone ComfyUI-SaveImageWithMetaData to custom_nodes/
  2. Launch ComfyUI v0.8+
  3. Check comfyui.log — extension shows IMPORT FAILED

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions