2026-03-08 21:21:22 -05:00
2026-03-08 11:41:58 -05:00
2026-03-08 10:30:08 -05:00
2026-03-08 11:41:58 -05:00
2026-03-08 10:30:08 -05:00
2026-03-08 21:13:24 -05:00
2026-03-08 21:21:22 -05:00

comfyui-node-template

A simple ComfyUI node development starter template.

Custom Node Class

Start by defining a node class.

class MyComfyNode:

    __init__(self):
        pass

Input Map

Required Inputs

@classmethod
def INPUT_TYPES(cls):
    return {"required": {
        # entry components go here,
    }}

If the node does not require any inputs:

@classmethod
def INPUT_TYPES(cls):
    return {}

Entry Components

STRING

Creates a string type entry.

"strval": ("STRING", {"default": "a string", "tooltip": "a string entry"})

FLOAT

Creates a float slider entry.

"floatval": ("FLOAT", {"default": 20.0, "min" 0.5, "max": 150.0, "step": 0.5, "tooltip": "a float"})

INT

Create a integer slider entry.

"intval": ("INT", {"default": 2, "min": 1, "max": 10, "tootip": "an integer"})

BOOLEAN

Create a boolean switch entry.

"boolval": ("BOOLEAN", {"default": False, "tooltip": "a boolean toggle"})

Output (RETURN) Map

Use the same constants as inputs.

RETURN_TYPES = ("STRING", "STRING", "FLOAT",) #output type
RETURN_NAMES = ("model", "vae", "amount",) # display name

Activation Function

FUNCTION = "execute"

def execute(self):
    pass #do work

Metadata

CATEGORY = "<category>/MyComfyNode"
DESCRIPTION = "My handy ComfyUI node"

Node Mappings

NODE_CLASS_MAPPINGS = {
    "MyComfyNode": MyComfyNode,
}

NODE_DISPLAY_NAME_MAPPINGS = {
    "MyComfyNode": "My ComfyUI Node"
}

Node placement

The custom node directory goes in comfyui/custom_nodes/<my-comfy-node>

S
Description
No description provided
Readme MIT
35 KiB
Languages
Python 100%