# Split Text

> Cut one text into a list of items at each new line, comma or custom separator, so the next node runs once for every item, such as one image per line.

Source: https://nodaro.ai/docs/nodes/automate/split-text

The **Split Text** node cuts one text into a list of items at a separator, such as each new line. The node you connect after it runs once for every item, so one text with ten lines becomes ten images, ten voice clips or ten videos. Split Text costs no credits and runs without a model.

- Found in: Automate › Text
- Output: text
- API type: `split-text`

## When to use it
- Write one prompt per line and generate one image or video for each.
- Cut a script into scenes, then generate a shot per scene.
- Turn a comma-separated list of subjects into separate items.
- Cut the answer of a [Prompt](https://nodaro.ai/docs/nodes/automate/prompt) node into parts at a separator of your choice.

## Quick start
### Add the node

Press Tab on the canvas and choose **Automate › Text › Split Text**.

### Connect a text

Connect a [Text](https://nodaro.ai/docs/nodes/automate/text) node, or any other text node, to the **Text** input.

### Choose the separator

Open the settings panel and choose a **Separator**. The default, **New Line (\n)**, makes one item per line. **Preview** shows the items after a run.

### Connect the next node and run it

Connect the output to the node that should run per item, such as the **Prompt** input of [Generate Image](https://nodaro.ai/docs/nodes/image/generate-image). Run it: the node runs once for every item.

Workflow: A Text node with three lines becomes three items, and Generate Image runs once for each.

- Text → Split Text (text)
- Split Text → Generate Image (prompt)

## Inputs
| Input | Accepts | What it does |
| --- | --- | --- |
| **Text** | Text nodes, such as Text, Prompt and Combine Text | The text to cut into items. |

The output, **Text**, is the list of items. A node connected to it runs once per item.

## Settings
| Setting | What it does |
| --- | --- |
| **Separator** | Where the text is cut: **New Line (\n)** (the default), **Double New Line (\n\n)**, **Comma (,)**, **Space**, **Three Stars (\*\*\*)** or **Custom**. |
| **Custom Separator** | The separator you type yourself, when **Separator** is **Custom**, for example `===NEXT===`. |
| **Trim whitespace** | **On** (the default) removes the spaces and line breaks around each item. |
| **Remove empty** | **On** (the default) drops empty items, such as the ones blank lines create. |
| **Preview** | The items of the last run, numbered. Read-only. |

## One run per item, or all items at once

A connection from Split Text is set to **Each** by default: the next node runs once for every item, and you get one result per item. Click the connection to change it:

| Mode | What the next node receives | Use it for |
| --- | --- | --- |
| **Each** (default) | One item per run | One image, video or voice clip per item |
| **Bundle** | Every item together, in one run | Nodes that combine a whole set |
| **Item** | One item that you choose by position, such as `2` or `last` | Using a single item |

In **Each** and **Bundle** mode you can also pass only some items, such as `1..5` for the first five. Read [Lists and batching](https://nodaro.ai/docs/concepts/lists-and-batching) for every option.

## Credits
Split Text itself is free. The node after it is charged once per item, so the cost grows with the number of items. Ten items into a node that costs 20 credits cost about 200 credits. The **Run** button of that node shows the total before you start.

## Tips
- **Check the preview first.** Run Split Text on its own and read **Preview** before you run an expensive node after it.
- **Test with a few items.** Set the connection to pass only `1..2` while you try a workflow, then remove the range for the full run.
- **Let a model write the items.** A [Prompt](https://nodaro.ai/docs/nodes/automate/prompt) node can write several prompts at once. Its **Items** output already splits the answer at `===NEXT===`, so you do not need Split Text for that separator.
- **For a table of values, use a List.** When each run needs several values, such as a prompt and an image, a [List](https://nodaro.ai/docs/nodes/automate/list) node holds one row per run.

## Frequently asked questions

### What does the Split Text node do?

Split Text cuts one text into a list of items at a separator, such as each new line. The node connected after it then runs once for every item. Split Text itself costs no credits.

### How do I generate one image per line of text?

Write one prompt per line in a Text node, connect it to Split Text with the New Line separator, and connect Split Text to the Prompt input of Generate Image. Generate Image runs once per line.

### Why do I get empty items?

Empty items come from blank lines or double separators. Keep Remove empty on, which is the default, and Split Text drops them.

### How do I pass all the items to one node at once?

Click the connection after Split Text and set it to Bundle. The next node then runs once and receives every item together.

### How much does a Split Text run cost?

Split Text is free, but every item runs the next node once. Ten items into an image node that costs 20 credits cost about 200 credits. The Run button of the next node shows the total before you start.
