Data and logic nodes in Nodespell work with values instead of media: text, numbers, true/false values, lists (arrays) and key-value objects. Use them to build prompts from parts, calculate parameter values, choose between inputs, and repeat work for every item in a list. They run in your browser and never use credits.
Add any of them with the Tab menu by typing the label shown below, or browse them in the Node Browser. The output of a data node connects to any compatible input or parameter, including a model’s prompt.
Text nodes
Section titled “Text nodes”| Node | Use it to |
|---|---|
| String Template | Fill a template such as A photo of ${0} at ${1} with the strings connected to Strings. |
| String Concat | Join several strings, with an optional Prefix, Separator and Suffix. |
| String Replace | Replace text; wrap the search in /…/ to use a regular expression. |
| String Split | Split text into an array at a Separator. |
| String Case | Change case, for example Upper Case, Sentence Case or Kebab Case. |
| String Trim, String Pad, String Slice | Clean up, pad or cut text. |
| String Length, String Includes, String Ends With | Measure or test text. |
Number and math nodes
Section titled “Number and math nodes”| Node | Use it to |
|---|---|
| Plus, Minus, Multiply, Divide, Remainder, Exponent | Basic arithmetic on First and Second. |
| Remap | Map a value from one range to another, for example 0–1 to 0–100. |
| Clamp | Keep a value between Min and Max. |
| Round, Floor, Ceiling, Truncate | Turn a number into a whole number. |
| Random | Return a number between 0 and 1; set Seed to make it repeatable. |
| Noise | Return a smooth noise value between 0 and 1. |
| Minimum, Maximum, Absolute, Negate, Sign, Square Root | Other common operations. |
| Is Finite, Is Integer, Is NaN | Test a number. |
List (array) nodes
Section titled “List (array) nodes”| Node | Use it to |
|---|---|
| Merge As Array | Collect several values into one array. |
| Array Get Element | Read one item by index (0 is the first). |
| Array Length | Count the items. |
| Array Range | Make a sequence of numbers, such as 0 to 10 in steps of 0.5. |
| Array Slice, Array Take | Keep part of an array. |
| Array Filter, Array Deduplicate | Remove empty, unwanted or repeated items. |
| Array Sort, Array Reverse, Array Shuffle | Reorder items; Array Shuffle accepts a seed. |
| Array Append, Array Insert Item, Array Remove Item, Array Set Element | Edit items. |
| Array Concat, Array Flatten, Array Chunk, Array Zip, Repeat | Combine, flatten, split or repeat arrays. |
Object and JSON nodes
Section titled “Object and JSON nodes”| Node | Use it to |
|---|---|
| JSON Parse | Turn JSON text, such as a text model’s structured answer, into an object. |
| JSON Stringify | Turn an object back into text. |
| Object Get Key | Read one value by its key. |
| Create Object, Key Value Pair | Build an object. |
| Object Add Key, Object Delete Key, Object Rename Key, Object Merge, Object Filter | Edit an object. |
| Object Entries, Object From Entries, Array Zip Object | Convert between objects and arrays. |
Logic, flow control and conversion nodes
Section titled “Logic, flow control and conversion nodes”| Node | Use it to |
|---|---|
| If Else | Output True Value or False Value depending on Condition. |
| Compare | Compare two numbers with Equal, Less Than, Greater Than and similar operations. |
| String Compare | Compare two strings, optionally ignoring case or whitespace. |
| Gate | Combine two true/false values with AND, OR, XOR, NOT and others. |
| Switch Input | Pass through one of several connected inputs, chosen by its index in Which (0 is the first). |
| Is Falsy, Is Nullish | Test whether a value is empty or missing. |
| Map Container | Run the nodes inside it once for every item in an array. |
| String To Float, String To Int, To String, To Fixed, To Precision, To Exponential | Convert between text and numbers. |
| Constant | Hold a fixed String, Number or Boolean value. |
| Reference | Read another node’s output without a connection. |
| Type Of | Report the type of a value. |
| Dot, No Operation | Pass a value through unchanged to tidy connections. |
Example: build a prompt from a template
Section titled “Example: build a prompt from a template”- Add two Constant nodes with Value Type set to String, for example
a red bicycleandgolden hour. - Add a String Template node and set Template String to
Product photo of ${0}, lit at ${1}. - Connect both constants to its Strings input, in order. The first connection fills
${0}, the second${1}. - Connect the template’s Value output to the prompt input of an image model and run it.
Change either constant and run again to try a new subject or light without retyping the prompt. For writing longer prompts by hand, see Prompts and saved text.
Example: repeat work for every item in a list
Section titled “Example: repeat work for every item in a list”- Add a Constant with the text
cat, dog, foxand connect it to a String Split node with Separator set to,. - Add a Map Container and connect the split Output to its Items input.
- Select the Map Container and press
Enterto go inside. - Add a Map Item node (the current item), connect it to a String Case node set to Upper Case, and connect that to a Map Output node.
- Press
Uto go back out, select the Map Container, and run it.
The Values output returns the results in the original order: CAT, DOG, FOX. Inside the container, Map Index gives the item’s position and Map Length the total. Max Concurrency (default 4, up to 16) sets how many items run at once. Right-click the container and choose Inspect Map Runs to see each item’s result.
Example: choose between two values
Section titled “Example: choose between two values”- Connect a number, such as a Random node with a seed, to Left on a Compare node. Set Right to
0.5and Operation to Greater Than. - Connect the Compare output to Condition on an If Else node.
- Connect two prompts, one to True Value and one to False Value, and use the If Else output downstream.
For a fixed choice from several options, use Switch Input and set Which instead.
Example: read a field from JSON
Section titled “Example: read a field from JSON”Connect a text model’s output that contains JSON to JSON Parse, then connect the parsed object to Object Get Key and set Key, for example title. The output is that field’s value, ready to use in a String Template or as a parameter.
Frequently asked questions
Section titled “Frequently asked questions”Do data and logic nodes cost credits?
Section titled “Do data and logic nodes cost credits?”No. They calculate in your browser and appear in run plans as free updates.
How do I insert values into a prompt?
Section titled “How do I insert values into a prompt?”Use String Template with ${0}, ${1} and so on in Template String, and connect the values to Strings in order. You can also write expressions directly in parameters.
How do I loop over a list in Nodespell?
Section titled “How do I loop over a list in Nodespell?”Put the work inside a Map Container, use Map Item for the current item and Map Output for each result, and connect your array to Items.
What is the difference between Constant and a typed parameter?
Section titled “What is the difference between Constant and a typed parameter?”A Constant is a node whose output you can connect to many inputs, so one value can drive several nodes. A parameter value belongs to a single node.
Related
Section titled “Related”- Expressions: calculate parameter values inline
- Connections: which outputs fit which inputs
- Levels and Folders: going inside nodes with
EnterandU - Prompts and saved text: the Prompt node