# Batch Node

The Batch Node allows you to aggregate multiple images, videos, or text items and process them all through one or more downstream generation nodes. Instead of manually running the same operation multiple times, the Batch Node automates bulk processing—saving time and ensuring consistency across all your outputs.

{% embed url="<https://www.youtube.com/watch?v=tUuAIZFtftU>" %}

## Overview

The Batch Node is designed for workflows where you need to apply the same transformation to multiple inputs:

* **Upscale a collection of images** using the same enhancement model
* **Generate variations** from multiple reference images
* **Apply consistent styling** across a set of base images
* **Process multiple text prompts** through the same generation pipeline

Think of it as a "for each" loop for your creative workflow—define the operation once, and the Batch Node applies it to every item in the collection.

{% embed url="<https://www.youtube.com/watch?v=sAm-4UGDhJI>" %}

***

## Getting Started

### Adding a Batch Node

{% stepper %}
{% step %}
**Add the Node**

From the node menu, select **Batch** to add it to your canvas.
{% endstep %}

{% step %}
**Add Items to the Batch**

Populate your batch with items using any of these methods:

* **Connect upstream nodes** - Link image, video, or text nodes to the batch input
* **Upload files** - Click the Upload button or drag-and-drop files onto the node
* **Drag from asset library** - Pull items from your workspace history or assets
  {% endstep %}

{% step %}
**Connect a Generation Node**

Link the Batch Node output to a generation node (Image, Video, or Text). This defines what operation will be applied to each item.
{% endstep %}

{% step %}
**Run the Generation**

Execute the downstream node. The batch automatically processes all items in parallel, creating separate outputs for each input.
{% endstep %}
{% endstepper %}

***

## Adding Items to a Batch

### Connecting Upstream Nodes

The most common way to populate a batch is by connecting other nodes:

1. Create your source nodes (image generators, uploads, etc.)
2. Connect each source to the Batch Node's input handle
3. When source nodes produce output, those outputs appear as items in your batch

Multiple nodes can feed into the same batch, allowing you to collect outputs from various sources.

### Uploading Files

Click the **Upload** button in the Batch Node to select files from your computer, or simply drag-and-drop files directly onto the node.

**Supported file types:**

| Modality | Formats                   |
| -------- | ------------------------- |
| Images   | PNG, JPG, JPEG, WEBP, SVG |
| Videos   | MP4, WEBM, MOV            |
| Text     | CSV                       |

### Uploading a CSV

You can upload a `.csv` file to quickly populate a text batch. FLORA reads the first column of each row and creates one batch item per row. All rows are included (there is no header skip), so remove any header row you don't want processed.

Drag-and-drop a CSV onto the node, or click **Upload** and select a `.csv` file. You'll see a toast confirming how many rows were added. If the batch already has items, the new rows are appended up to the 100-item limit.

### Dragging from Assets

Drag items from the workspace sidebar directly onto the Batch Node:

* **History** - Previously generated images or videos
* **Assets** - Saved items in your workspace
* **Unsplash** - Stock photos from the Unsplash integration

### Splitting Text Inputs

When text nodes are connected to a batch, a **text split toolbar** appears above the node. This lets you split each connected text node's content into separate batch items using a delimiter.

The toolbar offers three modes via the **Input split** dropdown:

* **None** (default) — Each connected text node is one batch item
* **By line** — Splits on newlines, so each line becomes its own batch item
* **Custom** — Splits on any string you type (e.g. `;`, `|`, `//`)

For example, if a text node contains `"cat\ndog\nbird"` and you select **By line**, the batch will contain three items: "cat", "dog", and "bird". Empty and whitespace-only segments are automatically filtered out.

{% hint style="info" %}
Text splitting and CSV upload work together — CSV-uploaded items are preserved when you change the split mode, and vice versa.
{% endhint %}

***

## Modality Locking

The Batch Node locks to a single content type (modality) once you add your first item:

* Add an image → the batch becomes an **image batch**
* Add a video → the batch becomes a **video batch**
* Connect a text node → the batch becomes a **text batch**

{% hint style="info" %}
You cannot mix different content types in the same batch. All items must be the same modality (all images, all videos, or all text).
{% endhint %}

If you remove all items from a batch, the modality lock is released, allowing you to start fresh with a different content type.

***

## The Batch Interface

### Header

Displays the batch icon, the current modality (if set), and the total item count.

### Item List

Shows all items currently in the batch with:

* **Thumbnail** for images and videos
* **Text preview** (first 100 characters) for text items
* **Source label** indicating where the item came from
* **Delete option** to remove individual items

### Footer

* **Upload button** to add more items
* **Add Generation Node** button to quickly connect a downstream processing node

***

## Processing a Batch

### How Batch Execution Works

When you run a generation node connected to a batch:

1. **Usage validation** - FLORA checks you have sufficient budget for all items
2. **Task creation** - A separate generation task is created for each batch item
3. **Parallel processing** - All items are processed simultaneously
4. **Output creation** - Each item produces its own output in the generation history

### Cost Calculation

Batch processing costs are calculated as:

```
Total Cost = Generation Cost per Item × Number of Items
```

For example, if upscaling costs $0.05 per image and your batch contains 10 images, the total cost is $0.50.

{% hint style="info" %}
FLORA validates your usage budget before starting. If you don't have enough budget for all items, the batch won't start.
{% endhint %}

### Generation Limits

* **Maximum items per batch execution**: 100 items
* If your batch contains more than 100 items, you'll need to run the generation multiple times

***

## Connecting to Generation Nodes

### Quick Connect

Click the **arrow button** in the Batch Node footer to open a node selection modal. Choose a generation node type to automatically create and connect it.

### Manual Connection

Drag from the Batch Node's output handle to any compatible generation node:

* **Image Node** - For image-to-image transformations, upscaling, style transfer
* **Video Node** - For image-to-video generation
* **Text Node** - For image-to-text or text processing

### How Connections Work

When a batch is connected to a downstream node:

* **Image batches** replace the image input for each generation
* **Video batches** replace the video input for each generation
* **Text batches** inject text content into the prompt parameter

The downstream node's settings (model, parameters, prompt) apply identically to every item in the batch.

### Multiple Downstream Nodes

A single Batch Node can connect to multiple generation nodes downstream. Each downstream node independently processes every item in the batch, so one collection of inputs can feed into several different operations at once.

***

## Workflow Examples

### Example 1: Batch Upscaling

```
[Image 1] ─┐
[Image 2] ─┼─→ [Batch Node] ─→ [Image Node: Upscale] → 3 upscaled outputs
[Image 3] ─┘     (3 items)       (Magnific 2x)
```

All three images are upscaled using the same model and settings.

### Example 2: Style Transfer Across Multiple Images

```
[Photo 1] ─┐
[Photo 2] ─┼─→ [Batch Node] ─→ [Image Node] → 4 stylized outputs
[Photo 3] ─┤     (4 items)     "anime style"
[Photo 4] ─┘
```

Apply the same "anime style" prompt to all four photos.

### Example 3: Generate Videos from Multiple Images

```
[Product Shot 1] ─┐
[Product Shot 2] ─┼─→ [Batch Node] ─→ [Video Node] → 3 product videos
[Product Shot 3] ─┘     (3 items)     "slow zoom"
```

Create video animations from multiple product images.

***

## Managing Batch Items

### Removing Items

Hover over an item in the batch list and click the delete button to remove it. Removing an item also disconnects it from any source node.

### Clearing the Batch

Remove all items to reset the batch completely, including its modality lock.

### Item Sources

Each item displays its source:

* **Node name** - For items from connected nodes
* **"Uploaded file"** - For manually uploaded items

***

## Tips for Effective Batch Processing

* **Consistent quality** - Ensure all source images have similar quality and dimensions for best results
* **Test first** - Run a single item through your generation node before processing the full batch
* **Check your budget** - Verify you have enough usage budget before starting large batches
* **Monitor progress** - Each item generates independently, so you can see results as they complete
* **Organize sources** - Name your source nodes clearly to track which outputs came from which inputs

***

## Limitations

| Limitation              | Details                                          |
| ----------------------- | ------------------------------------------------ |
| Single modality only    | Cannot mix images, videos, and text in one batch |
| CSV first column only   | CSV upload reads only the first column per row   |
| 100 items per execution | Larger batches require multiple runs             |
| Same settings for all   | Cannot customize parameters per item             |

***

## Common Use Cases

* **Product photography** - Apply consistent editing to an entire product line
* **Social media content** - Generate multiple variations for A/B testing
* **Asset preparation** - Upscale or enhance a collection of images at once
* **Video creation** - Turn a series of images into individual video clips
* **Style exploration** - Apply different models to the same set of inputs (using multiple batches)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flora.ai/nodes/batch-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
