Iterators allow you to run a workflow multiple times with different inputs, enabling powerful batch processing capabilities.
How Iterators Work
An iterator node takes a collection of items (text lines or media files) and executes the downstream workflow once for each item.
┌─── Iteration 1 ───┐
[Iterator] ────────>│ [Process] │──> [Collect Results]
(N items) ├─── Iteration 2 ───┤
│ [Process] │
├─── Iteration N ───┤
│ [Process] │
└───────────────────┘
Text Iterator
Processes each line of a multi-line text input as a separate workflow run.
Setup
- Drag a Text Iterator node onto the canvas
- Enter multiple lines of text (one item per line)
- Connect the iterator’s output to downstream nodes
- The workflow runs once per line
Example: Multiple Prompts
Generate images for multiple prompts:
[Text Iterator] [Model] ──> [Export]
┌──────────────────┐ ↑
│ A sunset beach │ │
│ A mountain lake │ ──current_text────>│
│ A forest path │
│ A city skyline │
└──────────────────┘
This generates 4 images, one for each prompt.
Example: Style Variations
Apply different styles to the same base prompt:
[Text Input] [Prompt Concatenator] ──> [Model] ──> [Export]
"A portrait" ──────> ↑
│
[Text Iterator] ──────────────┘
┌──────────────────┐
│ in watercolor │
│ as oil painting │
│ in pencil sketch │
│ in pop art style │
└──────────────────┘
Generates 4 portraits with different artistic styles.
Processes each uploaded file (image or video) as a separate workflow run.
Setup
- Drag a Media Iterator node onto the canvas
- Upload multiple files via the upload interface
- Connect the iterator’s output to downstream nodes
- The workflow runs once per file
Example: Batch Enhancement
Enhance a folder of images:
[Media Iterator] [Upscale Model] ──> [Export]
┌────────────────┐ ↑
│ photo1.jpg │ │
│ photo2.jpg │ ──current_image────────┘
│ photo3.jpg │
│ ... │
└────────────────┘
Example: Batch Processing Pipeline
Apply multiple operations to all images:
[Media Iterator] ──> [Resize] ──> [Crop] ──> [Filter] ──> [Export]
(50 images)
All 50 images are processed through the same pipeline.
Combining Iterators
Text + Fixed Image
Apply multiple prompts to a single reference image:
[Image Input] ──────────────────────────┐
↓
[Text Iterator] ──> [Prompt] ──> [Img2Img Model] ──> [Export]
┌──────────────┐
│ make it blue │
│ add sunset │
│ winter scene │
└──────────────┘
Process multiple images with the same settings:
[Media Iterator] ──────────────┐
├──> [Model] ──> [Export]
[Text Input: "enhance"] ───────┘
Batch Output
Collected Results
Iterator runs produce multiple outputs. The Export node collects all results:
Export Results:
├── output_001.png (from iteration 1)
├── output_002.png (from iteration 2)
├── output_003.png (from iteration 3)
└── output_004.png (from iteration 4)
Naming Patterns
Configure export filename patterns:
{index} - Iteration number (001, 002, …)
{input} - Original input filename (for media)
{timestamp} - Generation timestamp
Example: batch_{index}_{timestamp}.png
Iterator Settings
Iteration Control
| Setting | Description |
|---|
| Max Iterations | Limit total runs (useful for testing) |
| Batch Size | Process N items in parallel |
| Continue on Error | Skip failed items instead of stopping |
Iterators can run iterations:
- Sequentially: One at a time, safer for rate-limited APIs
- In Parallel: Multiple at once, faster but uses more resources
Start with sequential execution to verify your workflow works, then enable parallel for production.
Common Patterns
Dataset Generation
Create training data:
[Text Iterator] ──> [Generate Model] ──> [Export]
┌──────────────────┐
│ cat sitting │
│ dog running │
│ bird flying │
│ ... │ → 1000 labeled images
│ (1000 prompts) │
└──────────────────┘
Content Pipeline
Process user uploads:
[Media Iterator] ──> [Remove BG] ──> [Resize] ──> [Optimize] ──> [Export]
(user photos)
A/B Testing
Generate variations:
[Text Input: "base prompt"]
│
├──> [Model A] ──> [Export A]
│
└──> [Model B] ──> [Export B]
Run this with different base prompts using Text Iterator.
Best Practices
Test with 1-2 items first - Verify your workflow before processing hundreds of items.
Monitor credit usage - Batch processing can consume credits quickly. Calculate estimated costs before large runs.
Use descriptive inputs - Name your input files or text lines meaningfully for easier output tracking.
Handle errors gracefully - Enable “Continue on Error” for large batches to avoid losing progress.
Limits
| Limit | Value |
|---|
| Max text lines | 1000 |
| Max media files | 500 |
| Max parallel iterations | 10 |
| Max total items per run | Depends on plan |
Troubleshooting
”Iterator timeout”
Large batches may exceed time limits:
- Reduce batch size
- Process in smaller chunks
- Contact support for higher limits
”Partial results”
Some iterations failed:
- Check the error log for failed items
- Verify input data quality
- Retry failed items separately
”Memory exceeded”
Too many parallel iterations:
- Reduce batch size
- Process sequentially
- Use smaller input files