Skip to content

Split Node

kleer001 edited this page Feb 6, 2025 · 1 revision

Split Node

A versatile node for splitting lists of strings into two parts based on various expressions. Takes a list of strings as input and splits it into selected items and remaining items using either list selection or random selection expressions.

Parameters

enabled (bool)

Enables/disables the node's functionality.

split_expr (str)

Expression defining how to split the input list. Supports two expression types:

Expression Types

1. List Selection Expression

Uses Python-style list slicing syntax: [index] or [start:end:step]

Examples

  • [0] - Selects the first item
  • [-1] - Selects the last item
  • [1:3] - Selects items at indices 1 and 2
  • [::2] - Selects every other item
  • [::-1] - Selects all items in reverse order
  • [1:] - Selects all items from index 1 onwards
  • [:-1] - Selects all items except the last one

2. Random Selection Expression

Format: random(seed[,count])

Seed Options

  • 'time' for time-based randomization
  • A number for deterministic randomization

Examples

  • random(time) - Randomly selects 1 item using current time as seed
  • random(42) - Randomly selects 1 item using seed 42
  • random(time,3) - Randomly selects 3 items using current time as seed
  • random(42,5) - Randomly selects 5 items using seed 42

Outputs

Output 0: Selected Items

Items that match the split expression criteria.

Output 1: Remaining Items

Items that weren't selected.

Output 2: Empty

Always empty list (reserved for future use).

Important Notes

  • Invalid or empty split expressions route all items to Selected Items output
  • Order is maintained within both selected and remaining outputs
  • Random selection count is capped at input list length

Clone this wiki locally