-
Notifications
You must be signed in to change notification settings - Fork 32
Developing custom nodes from webui extensions
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.
Note that ComfyUI nodes implemented in Webui extensions can only be loaded into ComfyUI if the user launches ComfyUI with sd-webui-comfyui.
Custom nodes should always be implemented directly intoComfyUI-folder/custom_nodes
if possible.
It can be useful to implement nodes in Webui extensions if they really need the Webui as a dependency.
Here is the directory structure expected by the custom node scanner:
extensions-root-directory
├─ sd-webui-your-extension
│ ├─ comfyui_custom_nodes
│ │ ├─ node1.py
│ │ ├─ node2.py
│ │ ...
│ │
│ └─ comfyui_custom_scripts
│ ├─ extensions
│ │ ├─ extension1.js
│ │ ...
│ │
│ ├─ script1.js
│ ├─ script2.js
│ ...
│
├─ sd-webui-another-extension
│ ├─ ...
│ ...
...
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/extensions/webui_scripts/sd-webui-your-extension/