How are these Custom Node created?
Group Nodes

Those "custom nodes" are really called Group Nodes.  You can create a group node by selecting a group of nodes and hitting Ctrl+G.  You can see and edit the contents of a group node by selecting it and pressing Tab.  Once created, you can add a group node with the Shift+A add menu under Group.



When editing a group node there are two special nodes. The Group Input node allows you to pass information into the group node by plugging its sockets into nodes in the group.  Likewise, the Group Output node allows information to pass out of the group node by plugging nodes in the group into its sockets.

You can quickly add inputs and outputs by plugging other nodes into the the empty circle node sockets at the bottom of the input/output nodes.


Click to enlarge.  This is a simple fake light group node I have created.

You can also add inputs and outputs (as well as remove them, change their names, default values, adjust minimum and maximum values, and change their order) in the N toolbar under the Interface rollout.





Group nodes are very useful for grouping specific node trees you use a lot.  I have created a few node groups I use frequently and included them in the startup file (with fake users) so I have them whenever I need to use them in any project.