List: from File (backend) (lab)
Read a text file into a list, straight off the backend machine
- list
- count
If your lists are big, or you manage them in your editor, or they're shared between several workflows, pasting them into a widget is the wrong move. List: from File (lab) reads a plain text file and turns it into a LIST - one value per line - and it does it on the backend, meaning the file lives on the machine actually running ComfyUI.
How it works
You give it a file_path - the full path on the backend machine, not a relative one and not a browser file. It reads the file, strips each line, drops blank lines, and optionally ignores lines starting with # (the strip_comments toggle, default on). Then the convert dropdown transforms each value, same options as the pack's other list nodes: disabled, integer, float, or boolean (with true/false, yes/no, on/off, 0/1 all accepted, plus none becoming Python None).
Outputs are list (LIST) and count (INT).
One genuinely clever detail in the code: ComfyUI decides whether to re-run a node by checking if its inputs changed - but a file isn't an input widget, so a node like this would normally be skipped on the next run. This node gets around that by computing an MD5 checksum of the file every time and folding it into the "has it changed?" check. Edit the file externally, re-run, and it picks up the new content without you touching the workflow. That's the kind of thing that only shows up in the source, and it makes the node behave the way you'd naively expect it to.
The inputs that matter
file_path- the one that will bite you. Full backend path, e.g.C:\Users\you\seeds.txton Windows or/home/you/prompts/seedlist.txton Linux.strip_comments- boolean, default true.convert- enum, default disabled.
Where people get burned
The path is backend-side. If your browser and ComfyUI run on the same machine (the common local case), type a path you can see in your own filesystem and you're fine. If you're remote, remember the file has to be on the server. Get the path wrong or miss the file and the node throws a FileNotFoundError and shows red - there's no fuzzy search, so double-check the path before you blame the workflow.
Second gotcha: conversion errors. convert to integer on a line that says 7.5 will crash the node the same way it does in ListFromString. If your file mixes whole and fractional values, use float. And don't expect the output to be a single string - this hands you a list; for a multiline string from a file, look at the Input nodes instead.
Install
Same as every node in the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/bugltd/ComfyLab-Pack.git
cd ComfyLab-Pack
pip install -r requirements.txt
Or ComfyUI Manager → ComfyLab Pack. Restart after installing. No model downloads; opencv-python is the only notably heavy dependency.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | full path to file (backend) | |
| strip_comments | BOOLEAN | true | ignore lines starting with '#' |
| convert | COMBO | disabled | convert each value to int, float or boolean for booleans, values like true/false, yes/no, on/off, 0/1... are accepted. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| list | LIST | list of values (one per line, optionally converted) |
| count | INT | number of values |