Load File Batch (Tlant)
Pick a file from a folder — by index, in order, or at random
- file_path
- filename_text
- filename_stem
- folder_path
- extension
- index
- count
Batch processing always starts with the same boring problem: getting the right file, in the right order, out of a folder. Load File Batch (Tlant) is the node that solves it in three different ways at once. Give it a folder path and it picks exactly one file - by a fixed index, by a persistent counter that walks through the folder one queue run at a time, or by a seed-stable random choice - and hands you the absolute path plus all the filename metadata you'll want downstream.
The mode dropdown is the whole personality of the node:
single_file- always the file atindexin the folder. Deterministic, good for a fixed reference image or a known test file.incremental_file- the batch-workhorse mode. Each run advances a counter, so a folder of 50 source videos gets processed 1, 2, 3… in order, wrapping around when it hits the end. The counter lives in a state file (tlant_toolkit_state.json) inside the pack's folder, keyed by yourlabelplus the folder and extension settings - which is how you keep several independent batches going without them stepping on each other.random- a seed-stable random pick viarandom.Random(seed). The seed widget has acontrol after generatetoggle, so you can lock one file in or roll a new one each run.
The other inputs are the ones you'll actually touch: path (the folder), extensions (a space-or-comma separated filter like png, jpg; empty means all files), recursive (search subfolders), and filename_text_extension - true gives you the filename with its extension, false gives you the bare stem.
Outputs cover the practical cases:
file_path- absolute path, ready to feed a Load Image, Load Video, or any path-taking node.filename_text,filename_stem,extension,folder_path- the pieces for naming saves or building captions.indexandcount- which file you're on and how many there are, handy for progress tracking or folder-based numbering.
Install
ComfyUI Manager → search ComfyUI-Tlant-Toolkit → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Tlant/ComfyUI-Tlant-Toolkit
Restart ComfyUI. Empty requirements.txt, no model downloads - one of the safest kinds of installs there is.
The gotchas that actually bite
The incremental counter is stateful, which surprises people. It's stored on disk in the pack directory, so a git pull of the pack won't reset it, but changing the label, path, or extensions creates a fresh counter - rename your folder mid-batch and you'll start over. Also, both incremental_file and random always re-execute (ComfyUI's cache is deliberately defeated), which means everything downstream reruns each queue. That's usually what you want in a batch; just don't loop it upstream of an expensive sampler and expect caching to save you. And if a folder has no matching files, the node raises rather than silently returning garbage - add the right extension filter or double-check the path.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | 3 options: single_file, incremental_file, random | |
| seed | INT | 00–18446744073709550000 | — |
| index | INT | 00–150000 | — |
| label | STRING | Batch 001 | — |
| path | STRING | — | |
| extensions | STRING | — | |
| recursive | BOOLEAN | false | — |
| filename_text_extension | COMBO | 2 options: true, false |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| file_path | STRING | — |
| filename_text | STRING | — |
| filename_stem | STRING | — |
| folder_path | STRING | — |
| extension | STRING | — |
| index | INT | — |
| count | INT | — |