Skip to content

Developing custom nodes from webui extensions

Plads edited this page Dec 17, 2023 · 35 revisions

You can implement ComfyUI custom nodes into other webui extensions. Upon startup, sd-webui-comfyui will scan the webui extensions and inject the nodes of enabled extensions into comfyui.

Here is the directory structure expected by the custom node scanner:

extensions-directory
└─ sd-webui-your-extension
    ├─ comfyui_custom_nodes
    │  ├─ node1.py
    │  ├─ node2.py
    │  ...
    └─ comfyui_custom_scripts
        ├─ extensions
        │  ├─ extension1.js
        │  ...
        ├─ script1.js
        ├─ script2.js
        ...

So, sd-webui-comfyui will scan for any of these 3 paths in your extension:

  • comfyui_custom_nodes/ contains python custom nodes. This is usually where the backends of the nodes are implemented. Here is an example from the comfyui repo.
  • comfyui_custom_scripts/ contains any additional javascript code you want comfyui to statically serve.
  • comfyui_custom_scripts/extensions/ contains javascript code for custom extensions. This is usually where you add your own custom ui elements. Here is an example from the comfyui repo

On the side of the web browser, if your extension directory is named "sd-webui-your-extension" and your ComfyUI server runs on port 8189, then any file under comfyui_custom_scripts/ will appear at the path http://localhost:8189/webui_scripts/sd-webui-your-extension/

Clone this wiki locally