ComfyUI Node
Load Text Line From File (Buff)
A ComfyUI node in utils with 16 inputs and 3 outputs.
Load Text Line From File (Buff)
- text
- source_file
- line_count
◄file_path►
◄selection_moderandom►
◄seed0►
◄index0►
◄text_override►
◄encodingutf-8►
◄ban_tags►
◄prefix►
◄suffix►
◄join_delimiter, ►
◄weight0.00►
◄skip_commentstrue►
◄skip_blank_linestrue►
◄strip_whitespacetrue►
◄replace_underscoresfalse►
◄pick_random_file_from_dirfalse►
Categoryutils
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | Path to a text file (.txt, .csv, etc.) or a directory. When a directory is given, a random .txt file is selected from it. Surrounding quotes are stripped automatically. | |
| selection_mode | COMBO | random | random: Pick a random line (seeded). index: Pick a specific line by index number. all: Return every line joined by the join_delimiter. sequential: Cycle through lines in order across executions. |
| seed | INT | 00–18446744073709550000 | Seed for random selection. Same seed + same file = same line. |
| index | INT | 00–18446744073709550000 | Line index to retrieve when selection_mode is 'index'. Wraps around if out of range. |
| text_overrideopt | STRING | When provided, this text is used instead of reading from file_path. All line selection and filtering still applies. Right-click and Convert to Input to connect a wire instead. | |
| encodingopt | COMBO | utf-8 | File encoding to use when reading the text file. |
| ban_tagsopt | STRING | Comma-separated list of tags/words to remove from the output. Surrounding commas and extra spaces are cleaned up. | |
| prefixopt | STRING | Text to prepend to the output. | |
| suffixopt | STRING | Text to append to the output. | |
| join_delimiteropt | STRING | , | Delimiter used to join lines when selection_mode is 'all'. |
| weightopt | FLOAT | 0.00-10–10 | When non-zero, wraps output as (text:weight) for prompt weighting. |
| skip_commentsopt | BOOLEAN | true | Skip lines starting with '#' (after stripping whitespace). |
| skip_blank_linesopt | BOOLEAN | true | Skip empty or whitespace-only lines. |
| strip_whitespaceopt | BOOLEAN | true | Strip leading/trailing whitespace from each line. |
| replace_underscoresopt | BOOLEAN | false | Replace underscores with spaces in the output text. |
| pick_random_file_from_diropt | BOOLEAN | false | When True and file_path is a directory, pick a random .txt file from it. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| source_file | STRING | — |
| line_count | INT | — |