Nodes/Doom_Flux_NodePack/Doom Image Loader
ComfyUI Node

Doom Image Loader

A batch image loader with two streams, filters, and three selection modes

By PeterMikhai·Created about a year ago·Updated 6 days ago· 1
Doom Image Loader
    • image_a
    • meta_a
    • image_b
    • meta_b
    modesingle_folder
    base_path
    second_path
    extensions*.png;*.jpg;*.jpeg;*.bmp;*.webp
    name_contains
    min_width0
    min_height0
    max_width0
    max_height0
    min_aspect0.00
    max_aspect0.00
    orientationnone
    sort_byname
    select_modesequential
    index_a0
    index_b0
    reset_indexfalse

    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 of base_path in 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_path must be an absolute path that exists, and any 0-vs-set filter confusion is worth a double-check - min_width of 0 is "no filter", but a forgotten max_aspect of, 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_index and drive both indices from the same counter (the pack's DoomIndexPairCounter is 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.

    CategoryDoom/Utils

    Inputs (17)

    NameTypeDefaultDescription
    modeCOMBOsingle_foldersingle_folder — одна папка; dual_parallel — два потока A/B; subfolders_seq — рекурсивно по подпапкам
    base_pathSTRINGПуть к папке A
    second_pathSTRINGПуть к папке B (mode=dual_parallel)
    extensionsSTRING*.png;*.jpg;*.jpeg;*.bmp;*.webpМаски расширений через ';'
    name_containsSTRINGФильтр по имени файла (подстрока)
    min_widthINT0Мин. ширина (0 — без фильтра)
    min_heightINT0Мин. высота (0 — без фильтра)
    max_widthINT0Макс. ширина (0 — без фильтра)
    max_heightINT0Макс. высота (0 — без фильтра)
    min_aspectFLOAT0.00Мин. аспект w/h (0 — без фильтра)
    max_aspectFLOAT0.00Макс. аспект w/h (0 — без фильтра)
    orientationCOMBOnoneФильтр по ориентации
    sort_byCOMBOnameСортировка списка
    select_modeCOMBOsequentialsequential — по порядку; random — случайно каждый раз; shuffle_once — случайно с шагом индекса
    index_aINT0Текущий индекс потока A
    index_bINT0Текущий индекс потока B
    reset_indexCOMBOfalsetrue — сбросить оба индекса в 0 при прогоне

    Outputs (4)

    NameTypeDescription
    image_aIMAGEВыбранное изображение потока A
    meta_aDICTМетаданные потока A (filename/width/height/aspect/index/total/source)
    image_bIMAGEВыбранное изображение потока B
    meta_bDICTМетаданные потока B