Nodes/ComfyUI illumorae/Select ITEM By Amount Generated
ComfyUI Node

Select ITEM By Amount Generated

Let a folder's own contents decide what to generate next

By CorvaeOboro·Created 8 months ago·Updated 7 days ago· 1
Select ITEM By Amount Generated
    • item_png_filepath
    • item_folder
    • item_name
    • item_names_list
    base_dir/tmp/ComfyUI/custom_nodes/ComfyUI_illumorae
    use_nestedupscale_structurefalse
    png_in_item_rootfalse
    require_prompt_sdxlfalse
    require_prompt_fluxfalse
    require_prompt_sd15false
    require_prompt_videofalse
    max_images_target5
    seed0
    debugfalse

    Most batch-generation setups pick randomly, which means the item you've already made forty images of keeps getting picked while the one with zero outputs waits forever. Select ITEM By Amount Generated, from the illumorae pack (CorvaeOboro's variation-exploration toolkit), inverts that logic: it looks at a project folder structure, counts how many generated and ranked images each item has, and picks the item with the least coverage. You wire its output into a loader, generate, save - and the graph slowly balances your whole project without you babysitting it.

    This is a niche tool built for a specific house style, so before you get invested, check whether your folder layout matches. The author's structure puts ranked outputs in Upscale/ITEM/gen/01 (best) and gen/02 (second), with unranked ones loose in gen/. The node has two discovery modes: the default simple structure, and use_nestedupscale_structure for that deeper layout. If your files live in a flat folder, this node is aimed past you.

    How it works

    It scans base_dir for items, then scores each one by a coverage priority ladder, straight from the source docstring:

    • primary: few unranked generations in gen/ (low gen_count) - most important
    • secondary: few ranked images in gen/01 - surfaces unreviewed items
    • quaternary: few ranked images in gen/02

    Then it builds a balanced round-robin schedule (seeded by seed) so low-coverage items appear more often in a batch, but you don't get stuck on a single item. The require_prompt_sdxl / require_prompt_flux / require_prompt_sd15 / require_prompt_video toggles add filters: an item is only eligible if the matching prompt file exists and actually contains text. Turn on debug and the node will print its whole decision trail to the console - which is how you'll want to learn what it's doing.

    Inputs and outputs

    • base_dir - the project root. Oddly, the default points at the pack's own folder, so change it to your real project directory.
    • max_images_target - how many images per item you consider "covered" (default 5).
    • seed - makes the round-robin schedule reproducible.

    Outputs, all strings: item_png_filepath (a PNG path for that item), item_folder, item_name, and item_names_list (the full ordered list of candidates). Wire the filepath into a loader, or the name into filename prefixes downstream - this node is designed to feed the pack's own external-path save/load nodes.

    Installing it

    ComfyUI Manager → search "illumorae" → install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/CorvaeOboro/ComfyUI_illumorae
    

    Restart. No models, no extra downloads - pure filesystem logic.

    Troubleshooting

    The realistic failure is a mismatch between your folder layout and its expectations: if nothing is ever selected, or it always selects the same thing, enable debug and read the console - the node will show you how it counted each folder. Remember the default base_dir is wrong for almost everyone, and the prompt-requirement toggles silently shrink your candidate pool if you turn them on without the matching prompt files. It's a clever little scheduler, but it only works inside the project structure it was written to understand.

    Categoryillumorae

    Inputs (10)

    NameTypeDefaultDescription
    base_dirSTRING/tmp/ComfyUI/custom_nodes/ComfyUI_illumorae
    use_nestedupscale_structureBOOLEANfalse
    png_in_item_rootBOOLEANfalse
    require_prompt_sdxlBOOLEANfalse
    require_prompt_fluxBOOLEANfalse
    require_prompt_sd15BOOLEANfalse
    require_prompt_videoBOOLEANfalse
    max_images_targetINT51–1000
    seedINT00–18446744073709550000
    debugoptBOOLEANfalse

    Outputs (4)

    NameTypeDescription
    item_png_filepathSTRING
    item_folderSTRING
    item_nameSTRING
    item_names_listSTRING