Custom nodes
In this guide, you will:
- Learn what custom nodes are
- Discover how to create your own custom nodes
- Understand how to integrate custom nodes into your project
By the end of this guide, you’ll be able to extend Intrepid AI with custom functionality tailored to your needs.
Intrepid Custom Nodes
Custom nodes are specialized graphs that encapsulate reusable logic. These graphs, defined with specific inputs and outputs, can be converted into independent nodes, enabling them to be used, shared, and edited like any other graph. Essentially, they function as the equivalent of functions in programming languages — written once and reused extensively, saving you significant time and effort.
A custom node defines its inputs using the Entry
macro and its outputs using the Exit
macro. These macros are special nodes required to specify input and output points for your
logic. Between these macros, you can implement any logic your node requires.
Creating a Custom Node
Let’s proceed with an example.
Let’s assume we need to build a node that takes age
as float and name
as string.
The internal logic of the node needs to convert the age
variable from float to integer and
the variable name
needs to be concatenated to another string to obtain
“Your name is ” <name>
.
Therefore, the outputs of this node would then be an integer and a string.
The macros entry
and exit
allow one to define the inputs and outputs of the custom node.
While the internal implementation will represent the logic of the node.
Once entry, exit and logic are all connected (and valid), one can select the entire graph
holding the SHIFT
key (entry and exit macros included) and right-click to show a menu.
Select option Make node
to convert the custom node implementation into
a node with inputs and ouputs that can be reused as any other native node.
After clicking on Make node
action, the node will be converted into a custom node with a title
assigned by the user. Nodes with duplicated names are not allowed.
Custom nodes can be edited and versioned in a non-destructive manner, just like any other graph.
Integrating Custom Nodes
Custom nodes can be searched for and added to any graph, just like native nodes.
You can use the left sidebar and Nodes
section as for any other native node in the library.
Custom nodes can also be shared with organizations or other users (Sharing widget in the right sidebar).