Nodes/D2 Nodes ComfyUI/D2 Folder Image Queue
ComfyUI Node

D2 Folder Image Queue

Batch-process a whole folder by just hitting queue once

By da2el-ai·Created 2 years ago·Updated 29 days ago· 66
D2 Folder Image Queue
  • image_count
  • queue_seed
  • progress_bar
  • refresh_btn
  • image_path
  • image_count
folder
extension*.*
include_subfoldersfalse
start_at0
auto_queuetrue
sort_byName
order_byA-Z

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 ** in folder directly).
  • start_at - skip to image N (0-indexed). Useful for resuming an interrupted batch.
  • auto_queue - true auto-queues the remaining images; false runs once and stops.
  • sort_by - Name, Date, or Random. 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 *.txt captions) 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.

CategoryD2/Image

Inputs (11)

NameTypeDefaultDescription
folderSTRING
extensionSTRING*.*
include_subfoldersBOOLEANfalse
start_atINT0
auto_queueBOOLEANtrue
sort_byCOMBOName3 options: Name, Date, Random
order_byCOMBOA-Z2 options: A-Z, Z-A
image_countoptD2_SIMPLE_TEXT
queue_seedoptD2_SEED
progress_baroptD2_PROGRESS_BAR
refresh_btnoptD2_BUTTON

Outputs (2)

NameTypeDescription
image_pathSTRING
image_countINT