Skip to content

Track custom node startup errors and expose via API endpoint#13184

Draft
Kosinkadink wants to merge 1 commit intomasterfrom
feature/custom-node-startup-errors
Draft

Track custom node startup errors and expose via API endpoint#13184
Kosinkadink wants to merge 1 commit intomasterfrom
feature/custom-node-startup-errors

Conversation

@Kosinkadink
Copy link
Copy Markdown
Member

Summary

Store import and prestartup errors for custom nodes and expose them via a new API endpoint, so the frontend/Manager can distinguish between a node pack that failed to import vs. one that is simply not installed.

Changes

  • nodes.py - Added NODE_STARTUP_ERRORS dict; populated on import failure in load_custom_node()
  • main.py - Populated NODE_STARTUP_ERRORS on prestartup script failure in execute_prestartup_script()
  • server.py - Added GET /custom_node_startup_errors endpoint returning the error dict as JSON

API

GET /custom_node_startup_errors

// Response (empty when no errors)
{}

// Response (with errors)
{
  "my_custom_node": {
    "module_path": "path/to/my_custom_node",
    "error": "No module named 'some_dependency'",
    "traceback": "Traceback (most recent call last):...",
    "phase": "import"
  }
}

Ref: Comfy-Org/ComfyUI-Desktop-2.0-Beta#303

Store import and prestartup errors in NODE_STARTUP_ERRORS dict (nodes.py,
main.py) and add GET /custom_node_startup_errors endpoint (server.py) so
the frontend/Manager can distinguish failed imports from missing nodes.

Ref: ComfyUI-Launcher#303
Amp-Thread-ID: https://ampcode.com/threads/T-019d2346-6e6f-75e0-a97f-cdb6e26859f7
Co-authored-by: Amp <amp@ampcode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant