ComfyUI Node Runs on cloud
Text List Sort
Put the entries of a text list in order: alphabetical, natural so img2 comes before img10, by length, or shuffled by a seed, optionally dropping repeats and blank entries. Names wired beside the texts, such as file names, move with their texts.
Text List Sort
- texts
- names
- texts
- names
- text
- name
- count
- removed
◄order▾►
◄seed0►
◄dedupefalse►
◄ignore_casetrue►
◄drop_emptyfalse►
CategoryWAS Suite/Text/List
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| texts | ARRAY,STRING | The entries to order: a LIST, such as Text Split to List's, or a STRING list, such as the captions Load Text Batch reads. | |
| order | COMBO | `as given` = unchanged; `a-z` / `z-a` = alphabetical; `natural` = digits read as numbers, img2 before img10; `shortest first` / `longest first` = by length; `shuffle` = random, set by seed. | |
| seed | INT | 00–18446744073709550000 | The shuffle's seed: the same seed and list always give the same order; another seed gives another. Read only by order `shuffle`. |
| dedupe | BOOLEAN | false | On = an entry repeating an earlier one is dropped, the first kept, so `a cat` and ` a cat ` leave one; off = repeats stay. |
| ignore_case | BOOLEAN | true | On = `Cat` and `cat` sort together and count as repeats for dedupe; off = capitals sort before lower case and differ. |
| drop_empty | BOOLEAN | false | On = an entry holding nothing or only spaces is dropped, so 3 captions with 1 blank give 2; off = blanks stay in place. |
| namesopt | ARRAY,STRING | Optional names running beside texts, one per text, as the filename_list from Load Image Batch. Each moves and drops with its text. Another count than texts stops the run. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| texts | ARRAY | The entries in their new order, on one wire for Text List Get, Text List to Text and the other list nodes. |
| names | ARRAY | The names in the same order as texts. Empty when names is not wired. |
| text | STRING | The entries in their new order as a STRING list, so a node reading it runs once per entry. An empty list stops the nodes reading it. |
| name | STRING | The names as a STRING list, in step with text. Stops the nodes reading it when names is not wired or the list is empty. |
| count | INT | How many entries came out. |
| removed | INT | How many entries dedupe and drop_empty took out. 0 = every entry came through. |