ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

add http routes for custom nodes

Open jtydhr88 opened this issue 4 months ago • 0 comments

Added two http routes for custom nodes, feature requested by @christian-byrne

  1. /custom_nodes - get all Installed custom nodes status, the return value will be
{
  "custom_nodes": [
    {
      "project_name": "comfyui_jc2",
      "status": "loaded",
      "node_count": 6,
      "nodes": [
        "JoyCaption2",
        "ExtraOptionsNode",
        "JoyCaption2_simple",
        "JoyCaptionBetaOne_Full",
        "ExtraOptionsNode_Beta",
        "JoyCaptionBetaOne_Simple"
      ]
    },
    {
      "project_name": "test-output-str",
      "status": "loaded",
      "node_count": 1,
      "nodes": [
        "Test"
      ]
    },
    {
      "project_name": "was-node-suite-comfyui",
      "status": "failed",
      "error": "No module named 'numba'"
    },
{
      "project_name": "comfyui-wd14-tagger",
      "status": "skipped",
      "error": "No NODE_CLASS_MAPPINGS found"
    },
    {
      "project_name": "websocket_image_save",
      "status": "loaded",
      "node_count": 1,
      "nodes": [
        "SaveImageWebsocket"
      ]
    }
  ],
  "total_count": 5,
  "loaded_count": 3,
  "failed_count": 1,
  "skipped_count": 1
}
  • project_name - it should be module name by default, if custom node has pyproject.toml and get project name successfully, will use it instead.
  • status - it should be loaded, failed or skipped
  • node_count, nodes - node information of this custom nodes
  • error - error message while loading this custom node project if fails to load

it will only load custom nodes (under custom_nodes folder) and ignore built-in nodes

  1. /custom_node/{project_name} - get detail from {project_name}

if project name exists, for example /custom_node/comfyui_jc2 , the return value should be

{
  "project_name": "comfyui_jc2",
  "status": "loaded",
  "node_count": 6,
  "nodes": [
    "JoyCaption2",
    "ExtraOptionsNode",
    "JoyCaption2_simple",
    "JoyCaptionBetaOne_Full",
    "ExtraOptionsNode_Beta",
    "JoyCaptionBetaOne_Simple"
  ]
}

if project name doesn't exist, for example /custom_node/abc, the return value should be

{
  "error": "Custom node 'abc' not found",
  "message": "The custom node 'abc' is not loaded or does not exist"
}

jtydhr88 avatar Jun 19 '25 00:06 jtydhr88