simpleflowgui.github.io

Custom Library Guide

To create a custom library, follow the steps below:

  1. Click on the triangle on the upper right corner on the main UI to expand the libraries list.

  1. Click on the plus icon above the Libraries label.

  1. Enter the name of the library to be created in the specified area. Notice that an underscore is used to represent spaces.

  1. Enter the name of a node to be added under the new library. Notice that an underscore is used to represent spaces.

  1. The new node name will be added on the left area under, click on the node name.

  1. For the input type dropdown menu on the right, select text input.

  1. Enter a name of the variable.

  1. Change the color of the node.

  1. Click on Add. Notice that the name of the variable will be added on the left. Clicking on it will remove it.

  1. Click on Back.

  1. The following code lines will be used as an exampe to print a string in the log box. It should be noted that to access any of the variables defined when the custom node is created, the name of the variable will be used as a key for the vars dictionary as follows inps["vars"]["NameOfVariable"]. Also, end the function code with a return statement to send the results back for further processing. To display an image, save the image data and assign the value to the key “data” in the returned object.
def Print_String(inps):
  writelog(inps["vars"]["String"])
  return{"string":inps["vars"]["String"]}
  1. Paste the node function on the right.

  1. Click on create.

  1. Refresh the page, and the library will be added along with the node.

To add another node to the already created new library, follow the same steps but enter the name of the existing library.

Note: For all imports, classes, and global functions, paste the code in the text area under “Paste Imports” label

Important Notes: