D2 Folder Image Queue
Batch-process a whole folder by just hitting queue once
- image_count
- queue_seed
- progress_bar
- refresh_btn
- image_path
- image_count
Want to run 200 images through an upscale, a face detail pass, a caption rewrite, or an img2img batch without building a loop node? D2 Folder Image Queue is the D2 pack's "one queue button for the whole folder" node. Each time it runs it hands you the path of the next image in the folder, and if auto_queue is on (it is, by default), ComfyUI automatically queues up one run per image - so you click Queue once and walk away.
This is a genuinely handy node and the workflow stays dumb-simple: folder → image path → whatever loads it → process → save. No while loops, no batch index math. It's the sequential counterpart to D2 Load Folder Images, which dumps the whole folder into one batch at once (use that when you need everything in memory, e.g. for a grid).
The inputs
folder- full path to the directory.extension- file filter, default*.*. You can give multiple patterns comma-separated, like*.png, *.jpg, *.webp.include_subfolders- recurse into subfolders (or write**infolderdirectly).start_at- skip to image N (0-indexed). Useful for resuming an interrupted batch.auto_queue-trueauto-queues the remaining images;falseruns once and stops.sort_by-Name,Date, orRandom.order_by-A-Z/Z-A.
It also shows a live image count as you point it at folders, and has a refresh_btn to rescan.
Outputs
image_path- full path of the current image. Feed it to a loader (or to D2 Load Text for*.txtcaptions) and you've got a batch pipeline.image_count- total images in the folder.
Installing it
ComfyUI Manager → search "D2-nodes-ComfyUI" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/da2el-ai/D2-nodes-ComfyUI
Restart. No model downloads; the whole pack's deps are piexif and charset-normalizer. Since v32.0.0 it needs ComfyUI's V3 schema - older ComfyUI builds should use the pack before 32.0.0.
Where people get burned
The queue state lives per-node: the pack keeps its file list in memory keyed to the node's ID, so if you point the same node at a different folder mid-queue, or change sort_by to Random (which fixes the order at queue start on purpose), you may get stale results until the list rebuilds. Also, start_at is 0-based - start_at: 0 is the first image, a change the author made deliberately and one that still trips people who assume 1. If you're chaining this into a caption-edit loop for LoRA training data, that's the intended use, and it works well - just don't change folder paths between queued runs.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| folder | STRING | — | |
| extension | STRING | *.* | — |
| include_subfolders | BOOLEAN | false | — |
| start_at | INT | 0 | — |
| auto_queue | BOOLEAN | true | — |
| sort_by | COMBO | Name | 3 options: Name, Date, Random |
| order_by | COMBO | A-Z | 2 options: A-Z, Z-A |
| image_countopt | D2_SIMPLE_TEXT | — | |
| queue_seedopt | D2_SEED | — | |
| progress_baropt | D2_PROGRESS_BAR | — | |
| refresh_btnopt | D2_BUTTON | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image_path | STRING | — |
| image_count | INT | — |