Qwen3-VL Folder Loader (Loop)
Feed one image at a time out of a folder — the loop's front door
- image
- filename
- total_count
- is_last
Qwen3-VL Folder Loader (Loop) is the pack's answer to "I don't want one giant batch output, I want to caption images one at a time inside a loop, so I can do something with each result." Where Batch Run chews through a folder and returns one blob, this node pulls a single image out of a folder by index - and hands you the loop bookkeeping (filename, total count, is_last) alongside it, so a loop controller knows where it stands.
It's the "folder as a sequence" abstraction, and it's the node that makes the pack's loop workflow different in kind from the batch workflow: each iteration of your loop gets the image and its filename and a flag saying whether this is the last one. That's everything you need to caption a folder, send each caption downstream, and stop cleanly when you run out.
The two inputs
- folder_path (STRING) - absolute path to the folder. Reads
png,jpg,jpeg,webp,bmpin sorted filename order (same file types and same "every image in this folder" scope as Batch Run, so the README's dedicated-folder warning applies here too). - index (INT) - the current loop index, 0-indexed (the tooltip says so explicitly). Default 0; the schema caps it at 10000. This is what your loop controller feeds in.
The four outputs, and how they wire up
- image (IMAGE) - the actual image, loaded from disk as RGB and converted to a ComfyUI image tensor. This is the input to Qwen3-VL Loop Run (Advanced).
- filename (STRING) - the bare filename (e.g.
frame_042.png). Handy if you're saving each caption alongside its source, or naming files for a batch image-gen step. - total_count (INT) - how many images are in the folder. Feed this into the loop's
total_loopsso the loop knows its own size without hardcoding. - is_last (BOOLEAN) - true when the current index is the final image. The loop controller reads this to stop. The node clamps out-of-range indexes (an index past the end just loads the last image and reports
is_last), so a slightly-over-running loop degrades gracefully instead of crashing.
How it works
Under the hood it's straightforward: glob the folder, sort the filenames, clamp the index into range, load that one file with PIL, convert to a float tensor in [0,1]. If the folder doesn't exist, it raises an error; if it's empty, it raises too - so a wrong path shows up as a loud failure, not a silent zero. It also prints a progress line to the console (Loaded image 12/200: frame_042.png), which is your friend on long folder walks.
The typical wiring
Model Loader → Loop Run, with Folder Loader's image → Loop Run's image, Folder Loader's total_count → Loop Run's total_loops, and the loop controller feeding Folder Loader's index from Loop Run's next_index output. Qwen3-VL Batch Info is a lighter alternative if all you need is the count, and Prompt Splitter plays the same "give me one item by index" role on the text side of batch workflows.
Install via ComfyUI Manager (search "qwen3-vl-comfy-ui") or clone https://github.com/Granddyser/qwen3-vl-comfy-ui into ComfyUI/custom_nodes + pip install -r requirements.txt, restart, and find it under Qwen3-VL. Folder Loader is the loop-specific piece you'll actually keep around - Batch Info is optional, this one is load-bearing.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | — | |
| index | INT | 00–10000 | Current loop index (0-indexed) |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| filename | STRING | — |
| total_count | INT | — |
| is_last | BOOLEAN | — |