1.3 KiB
1.3 KiB
type, title, description, resource, tags, timestamp
| type | title | description | resource | tags | timestamp | |||
|---|---|---|---|---|---|---|---|---|
| Guide | Add a New Node | Step-by-step guidance for adding a new ComfyUI v3 node to Sage Utils. | Unsloth_Project_Docs.md |
|
2026-07-01T00:00:00Z |
This concept documents how to add a new ComfyUI v3 node to Sage Utils.
Steps
- Define a custom I/O type in
nodes/custom_io_v3.pyif needed. - Add a new node class in the appropriate
nodes/*_v3.pyfile. - Implement
define_schema()with inputs, outputs, and metadata. - Implement
execute(**kwargs)to build the node output or graph. - If the node creates sub-graphs, use
GraphBuilder. - Import the node in
nodes/__init__.pyif required. - Add tests for node schema and execution.
Example
class Sage_MyNode(io.ComfyNode):
@classmethod
def define_schema(cls):
return io.Schema(
node_id="Sage_MyNode",
display_name="My Node",
description="Description of this node.",
category=f"{SAGE_UTILS_CAT}/my_category",
inputs=[...],
outputs=[...]
)
@classmethod
def execute(cls, **kwargs):
# Build result or graph
...
Notes
- Prefer structured custom types for node inputs and outputs.
- Keep new nodes consistent with existing ComfyUI v3 conventions.