Doom Image Loader
A batch image loader with two streams, filters, and three selection modes
- image_a
- meta_a
- image_b
- meta_b
Doom Image Loader is the pack's batch image loader, and the clue to its real purpose is the two-stream design. Beyond the stock "load one image by name" behavior, it reads from folders, applies filters, and - the distinctive part - drives two independent streams (A and B) so you can pair images from two folders and step through them in lockstep. If you've ever hand-built a "feed every image in this folder through the pipeline" graph, this is the node that makes it a config setting instead of a graph.
It's the front end of the pack's small data-utility family (Loader → Router → Resize), aimed at batch workflows: run a folder of source images through an img2img or reference pipeline, or generate a contact sheet, or build a comparison loop where stream A is the source and stream B is the style reference.
How it works
Three modes cover the layouts:
single_folder- one folder, stream A only.dual_parallel- two folders (base_path+second_path), streams A and B stepped independently, each with its own index.subfolders_seq- recursively walks subfolders ofbase_pathin sequence.
Selection is sequential (walk the index), random (new random pick each run), or shuffle_once (random with a stepped index). index_a / index_b are the current positions - bump them to move through a folder - and reset_index zeroes both per run.
The filters are where it gets genuinely useful: name_contains (substring), min_width/max_width/min_height/max_height (0 = off), min_aspect/max_aspect (w/h ratio range), and orientation (landscape/portrait/square). Combined with extensions (default *.png;*.jpg;*.jpeg;*.bmp;*.webp, ;-separated) and sort_by (name or date), you can narrow "all files" to "landscape PNGs between 1024 and 2048 wide, newest first" without a single line of code.
Outputs: image_a + meta_a and image_b + meta_b. The meta dicts carry filename/width/height/aspect/index/total/source - and that's the handshake with the pack's DoomImageRouter, which routes images based on exactly those fields.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/PeterMikhai/Doom_Flux_NodePack
Restart or use ComfyUI Manager. No extra deps; current ComfyUI (V3 API). The README's DoomAI_nodes.git line is stale - repo is Doom_Flux_NodePack.
Common issues
- Empty outputs, no error. Almost always a path or filter problem:
base_pathmust be an absolute path that exists, and any0-vs-set filter confusion is worth a double-check -min_widthof 0 is "no filter", but a forgottenmax_aspectof, say, 1 will silently drop every image wider than 1:1. - Sequential mode loops forever - it wraps with
index % length, so a folder of 3 images cycles 0→1→2→0. That's by design; use it as a loop, don't fight it. - Two streams out of step - each stream has its own index; if A and B are supposed to advance together, set
reset_indexand drive both indices from the same counter (the pack'sDoomIndexPairCounteris built for exactly this pairing problem). - Big folders are slow on first scan - the size/aspect filters open every candidate file with PIL to check dimensions, so a 10k-image folder plus dimension filters means a real delay on the first pass.
It's a utility node, but it's the utility node that makes "run my whole dataset through Flux.2 references" a two-minute setup instead of a small programming project.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | single_folder | single_folder — одна папка; dual_parallel — два потока A/B; subfolders_seq — рекурсивно по подпапкам |
| base_path | STRING | Путь к папке A | |
| second_path | STRING | Путь к папке B (mode=dual_parallel) | |
| extensions | STRING | *.png;*.jpg;*.jpeg;*.bmp;*.webp | Маски расширений через ';' |
| name_contains | STRING | Фильтр по имени файла (подстрока) | |
| min_width | INT | 0 | Мин. ширина (0 — без фильтра) |
| min_height | INT | 0 | Мин. высота (0 — без фильтра) |
| max_width | INT | 0 | Макс. ширина (0 — без фильтра) |
| max_height | INT | 0 | Макс. высота (0 — без фильтра) |
| min_aspect | FLOAT | 0.00 | Мин. аспект w/h (0 — без фильтра) |
| max_aspect | FLOAT | 0.00 | Макс. аспект w/h (0 — без фильтра) |
| orientation | COMBO | none | Фильтр по ориентации |
| sort_by | COMBO | name | Сортировка списка |
| select_mode | COMBO | sequential | sequential — по порядку; random — случайно каждый раз; shuffle_once — случайно с шагом индекса |
| index_a | INT | 0 | Текущий индекс потока A |
| index_b | INT | 0 | Текущий индекс потока B |
| reset_index | COMBO | false | true — сбросить оба индекса в 0 при прогоне |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image_a | IMAGE | Выбранное изображение потока A |
| meta_a | DICT | Метаданные потока A (filename/width/height/aspect/index/total/source) |
| image_b | IMAGE | Выбранное изображение потока B |
| meta_b | DICT | Метаданные потока B |