Node for handling text with automatic numbering of divisions and extraction of selected division(s).
A new text division is created for every Return/Enter.
Pick a text divison via the index and output only that text’s content (without the optional “n. ” prefix). Alternatively select several text divisions and an optional separator string. Empty lines are ignored.
Lightweight, no additional dependencies.
1-based indexing.
I find it useful for prompts. You get a new idea, hit enter and start anew without discarding the old; select, go back, combine; or you can load/paste a list of frequently used prompts and save/copy them for later. May also be useful in combination with a save node for several disk locations etc.
- Open ComfyUI Manager → Custom Nodes
- Search for NumberedText.
- Press Install and restart ComfyUI.
cd ComfyUI/custom_nodes/
git clone https://github.com/dehypnotic/comfyui-numbered-text.git
Restart ComfyUI.
- String of the whole text.
- Integer of selected text division.
- String of comma separated text divisions.
- String of optional separator.
- Integer of max text divisions for the numbered text output.
- String of selected text division(s).
- String of the whole text, numbered and limited by the max value.
MIT License. Feel free to modify; please keep attribution.