Get First Word (List)
The list version of Get First Word — for when you have a whole batch of prompts
- text
- list
Get First Word (List) is exactly what the name promises: the same "cut before the first stop word" transform as GetFirstWord, but applied to every element of a list instead of a single string. It's the sibling you reach for when you're not slicing one prompt - you're slicing dozens, and you want all the results back in one go.
The intended pairing is with the selected_list output of this pack's PromptPalette-F node. That node hands you the list of phrases you've checked, and this one turns each phrase into its first word. If your palette is built so that every phrase starts with a subject tag, you get a clean list of subjects in one pass - ready to drive filenames, folder names, or batch processing downstream.
The inputs
Everything that GetFirstWord has, plus one:
items- the list to process. Wire-only, feeds from any LIST output (likePromptPalette_F.selected_list).stop_word,use_regex,trim,remove_invalid_filename_chars,add_trailing_slash- identical to the single-string version, applied per element. Defaults match:stop_wordis,,trimon, the filename toggles off.text_separator- how the per-element results get joined in thetextoutput (default,). Does not affect thelistoutput.
The outputs
Two of them, and they're meaningfully different:
text- all the processed results joined withtext_separator. A flat string, ready to feed a filename or a text encoder.list- the raw processed results as a list, untouched by the separator. This is the one you want if you're looping or mapping over the results rather than concatenating.
That split is the whole reason the node exists: one output for "glue this together," one for "keep the structure."
Installing it
It's part of the PromptPalette-F pack, so:
cd ComfyUI/custom_nodes
git clone https://github.com/id-fa/ComfyUI-PromptPalette-F prompt-palette-f
cd prompt-palette-f
pip install -r requirements.txt
Restart, look under Prompt Palette-F. Or ComfyUI Manager → search "Prompt Palette-F" (you may get a slightly older snapshot). No models, no heavy deps - the pack's only pip dependency is googletrans, which this node doesn't touch.
The one trap
The list output doesn't re-apply the separator, which is the behavior you want - but don't confuse the two outputs when you're wiring things up. Also remember the same gotcha as the single version: it cuts at the first occurrence of the stop word, and a regex stop word that fails just passes each element through whole. If a phrase doesn't contain your delimiter at all, you get the whole phrase back. For the "extract subject from a batch of checked phrases" workflow, that's usually exactly right, and it's a lot less plumbing than a loop of single-string nodes.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| stop_word | STRING | , | — |
| use_regex | BOOLEAN | false | — |
| trim | BOOLEAN | true | — |
| remove_invalid_filename_chars | BOOLEAN | false | — |
| add_trailing_slash | BOOLEAN | false | — |
| text_separator | STRING | , | — |
| itemsopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| list | STRING | — |