TK Batch Image Loader
The folder feeder that gets a batch captioning run started
- image_paths
TK Batch Image Loader is the front door of this pack, and it's deliberately not a normal image loader. It doesn't hand you IMAGE tensors to wire into a sampler. It reads every image in a folder, renames them image_1.png, image_2.png, … and copies them into an output folder, then hands you back a LIST of file paths. That list is exactly what the batch interrogators in this pack - TK QwenVL Interrogator, TK JoyCaption Interrogator, TK WD14 Tagger - want on their input. Think of it as a filesystem pipeline stage: you don't get pixels, you get a manifest.
How it works
It lists source_path for the usual extensions (jpg, jpeg, png, bmp, webp), sorts them alphabetically so order is stable, and processes each one in turn. Two notes on scope: it only reads the top level of the folder - no recursion into subdirectories - and the "renaming" is really a copy into output_path under the new name, not an in-place rename.
There are two resize modes, and the pack's own UI code makes them mutually exclusive - flip one on and the other quietly switches off, so you can't feed both:
- resize_mp - scales to a total pixel count,
img_mpin megapixels (default 1.0). Handy for normalizing a mixed-resolution folder down to a uniform budget before a VLM eats it. - resize_px - scales the longest edge to
img_px(default 1024), keeping aspect ratio.
Both resize with PIL's LANCZOS, and if a resize throws an error the node falls back to a plain copy instead of killing your batch. If both toggles are off, this is a pure rename-and-copy stage.
The inputs that matter
You really only set three things:
- source_path - where the original images live.
- output_path - where renamed images land (created if missing).
- filename_prefix - default
image_, so you getimage_1.png,image_2.png, …
Everything else is optional resize behavior. The single output, image_paths (LIST), plugs straight into TK QwenVL Interrogator's image_paths input. On Windows, the defaults are C:/input_images and C:/output_images - if you don't change them, nothing happens and you'll wonder why.
Installation
cd ComfyUI/custom_nodes
git clone https://github.com/tackcrypto1031/tk_comfyui_imageVL.git
cd tk_comfyui_imageVL
pip install -r requirements.txt
Then restart ComfyUI. ComfyUI Manager works too - search the pack title tk_comfyui_imageVL. The loader itself only needs the base deps (Pillow is there), but the pack's requirements.txt pulls the full set (transformers, qwen-vl-utils, accelerate, huggingface-hub, sentencepiece, pandas, and onnxruntime for the tagger), so you get everything in one shot.
Where people get burned
- No subfolders. Throw a folder of folders at it and you'll only see the top level. Flatten first.
- Resize re-encodes. If
resize_mporresize_pxis on, the images inoutput_pathare resized JPEG/PNGs, not originals. If you want byte-identical files, leave both toggles off. - Stale paths. This is a batch-stage node, not a sampler feeder. If you expected an IMAGE output to preview or upscale, grab the single-image nodes from this pack instead - or a normal Load Image.
It's a simple tool doing a simple job, and for a folder of images headed into a VLM batch it's exactly the right opening move.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| source_path | STRING | C:/input_images | — |
| output_path | STRING | C:/output_images | — |
| filename_prefix | STRING | image_ | — |
| resize_mp | BOOLEAN | false | — |
| img_mp | FLOAT | 1.00.1–100 | — |
| resize_px | BOOLEAN | false | — |
| img_px | INT | 102464–8192 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image_paths | LIST | — |