ComfyUI Node

Round Robin

The batch node that makes sure every item gets its fair share

By isekai-sh·Created 9 months ago·Updated 8 months ago· 3
Round Robin
    • selected_item
    • progress_info
    • batch_count_needed
    text_listItem A Item B Item C
    images_per_item32
    batch_iddefault

    IsekaiRoundRobin is the node that fixes a specific, annoying ComfyUI problem: when you batch-generate, how do you cycle through a list of prompts, characters, or LoRA names so that each one gets the same number of images - instead of the graph picking one and staying stuck on it? It's a stateful cycling node: feed it a list, tell it how many images per item, and it rotates through the list in order, giving each entry its fair share before moving on.

    How it works. Give it a multiline text_list (one item per line), an images_per_item count, and a batch_id. The node writes an append-only log to ComfyUI's temp directory (temp/isekai/round_robin/<batch_id>.log) and uses it to remember where it is between executions. Every run returns the current item, then advances the counter; after images_per_item runs it moves to the next item, and after the whole list it wraps back to the start. That's why it's round robin and not "random." Crucially, it sets IS_CHANGED to return a fresh value every execution, which tells ComfyUI not to cache the node's output - so each image in a batch actually gets the next item instead of the graph reusing the first result. That single detail is the whole reason the node works in batch mode at all.

    State lives in a file, keyed by batch_id, and is wiped when ComfyUI restarts. Change images_per_item mid-batch and it detects the mismatch, warns you, and resets the counter.

    Outputs that matter. Three of them, and they're all useful:

    • selected_item (STRING) - the current item; wire this into your prompt or LoRA loader.
    • progress_info (STRING) - human-readable state like Item A: 15/32 | Total: 15/96, for a text display node.
    • batch_count_needed (INT) - the total executions needed to run every item once (items × images_per_item). You can literally read this value and feed it to your batch count node. That's the intended workflow: set batch count from this output, sit back, and every item gets covered.

    A realistic setup: list three character names in text_list, set images_per_item to 20, and run 60 total generations - you get 20 images per character, in strict rotation, with zero babysitting. It's the "batch 32 and get variety" pattern from the wildcard world, but organized instead of random.

    Install. Standard pack install: ComfyUI Manager → search "isekai" → install → restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/isekai-sh/isekai-comfy-node
    cd isekai-comfy-node
    pip install -r requirements.txt
    

    Restart; it's under Isekai → Dataset. No models, nothing heavy in requirements.txt.

    Common issues. If text_list is empty it returns an empty item with a "No items" progress string - check you didn't leave blank lines-only. The batch_id is sanitized to safe filename characters, so "my batch 1" becomes something file-safe, but two different batches with the same batch_id will share state and fight each other - give each batch its own ID. Because state is file-backed, the node's answer depends on run history, which is exactly what you want for fairness and exactly why you shouldn't use it when you need reproducible results: there's no seed here. And it's a young pack with no real community footprint, so if something misbehaves, the console log (lines prefixed [Isekai] Round Robin) is your documentation.

    CategoryIsekai/Dataset

    Inputs (3)

    NameTypeDefaultDescription
    text_listSTRINGItem A Item B Item C
    images_per_itemINT321–1000
    batch_idSTRINGdefault

    Outputs (3)

    NameTypeDescription
    selected_itemSTRING
    progress_infoSTRING
    batch_count_neededINT