This is a template repository that you can use as a starting point for building your own custom nodes for ComfyUI.
Follow these steps to get started with building your custom node:
- Clone the repository or click here.
- Rename Your Custom Node
- Modify the name of your custom node. It must be unique
- Change the
package.nameandlib.nameinCargo.tomlto your desired node name.
- Install Prerequisites:
- Build Your Node
Run the following command to generate a
.whlfile:This will generate amaturin build --release
.whlfile located at./target/wheels - Install the Wheel in Your ComfyUI Environment:
Install the generated .whl file into your ComfyUI environment:
pip install ./target/wheels/your_custom_node.whl
- Add the
__init__.pyFile At the root of your custom node directory, create an init.py file with the following content:from name_of_your_custom_node import *
- Restart your ComfyUI installation. Your custom node should now appear and be ready for use!
To share your custom node with the ComfyUI community and make it available on the registry, follow these steps:
-
Create an Account: Sign up and create a username at the ComfyUI Registry.
-
Install ComfyUI CLI: Download and install the ComfyUI CLI:
pip install comfy-cli
-
Update
pyproject.toml: Openpyproject.toml, ensure your custom node details are correct and update thePublisherIdwith your username from the ComfyUI registry. -
Publish Your Node:
comfy node publish.
Take a look at the install.py script. This is the first script that runs when your node is installed.
It ensures that your node compiles successfully by:
- Installing Rust if it's not already installed.
- Running
maturin build --release. - Installing the generated wheel using
pip.
Feel free to customize this script to fit your specific needs.