Skip to content

jhj0517/ComfyUI-CustomNodes-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComfyUI CustomNode Template

This is the ComfyUI custom node template repository that anyone can use to create their own custom nodes.

Directory Structure

Project-Name/
├── .github/                # GA workflow for publishing the ComfyUI registry 
├── workflows/              # Example workflows for your custom node
├── modules/                # Your own modules for the custom node
├── .gitignore              # gitignore file 
├── __init__.py             # Map your custom node display names here 
├── nodes.py                # Your custom node classes  
├── README.md               # README file
├── pyproject.toml          # Metadata file for the ComfyUI registry
└── requirements.txt        # Project dependencies 

Custom Node Files

This file is where your actual custom node classes are defined. The class has specific methods that are called by the ComfyUI engine. There're some basic custom nodes for the example with some comments, you can modify them as you need. For detailed information on how to create custom nodes, please refer to the ComfyUI official documentation:

You can map your custom node display names here. It will be used when users search for your custom node in the ComfyUI.

This file is used to publish your custom node to the ComfyUI registry. If you want to publish your custom node to the ComfyUI registry, you need to modify this file.

If you wonder what ComfyUI registry is, please read:

This file contains the dependencies needed for your custom node. torch is already installed in the ComfyUI, so you only need to add "extra" dependencies here.

This is optional, but it is recommended to put your ComfyUI workflow json file inside your project so users can easily understand how to use your custom node.

Github Actions

When you push into the master branch, this workflow will be triggered and publish your custom node to the ComfyUI registry, using your pyproject.toml. You have to register your "REGISTRY_ACCESS_TOKEN" in the Github Action Secrets which you can get from:

After generating the repository from this template, uncomment the push to enable the workflow with auto trigger:

# Uncomment the lines below to enable the workflow
# push:
# branches:
# - main
# - master
# paths:
# - "pyproject.toml"

Github Issue & PR templates

There are some basic templates for the Github issues & PR. You can edit them or add more to fit your project's needs.

How to Strat Using Template

Click "Use this template" -> "Create a new repository", then you can create your own custom node from there.

image

The custom node installation guide below can usually be used for any custom node, you can use it in your README by modifying the repository name and URL.

Installation

  1. git clone repository into ComfyUI\custom_nodes\
git clone https://github.com/replace-this-with-your-github-repository-url.git
  1. Go to ComfyUI\custom_nodes\ComfyUI-Your-CustomNode-Name and run
pip install -r requirements.txt

If you are using the portable version of ComfyUI, do this:

python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-Your-CustomNode-Name\requirements.txt

About

ComfyUI CustomNode Template

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages