Nodes/image_control/abyz22_SetQueue
ComfyUI Node

abyz22_SetQueue

A batch queue rig that expects the author's folder layout

By abyz22·Created 3 years ago·Updated 2 years ago· 17
abyz22_SetQueue
    • Bool_trigger_queue
    • folder_path
    • prompt
    • cur_prompts
    • cur_batch
    • debug
    mode_typeab
    Num_of_Prompts1
    image_per_Prompt24
    batch_size1
    seed1
    prompt

    abyz22_SetQueue is the brain of the batch-generation rig inside image_control. It coordinates "N prompts × M images each," creates a numbered output folder per prompt, logs every prompt to an Excel history file, and tells the workflow whether there's still more to generate. In the author's own pipeline this is what turns "generate a dataset" into a mostly hands-off loop. It's also the most personal node in the pack - and the one least likely to run as-is on your machine. Fair warning up front.

    How it works, from the source: the node keeps internal state (cur_prompts, cur_batch, highest_num) across runs. On the first run it scans the base output folder for numbered subfolders, sets highest_num to the max plus one, and writes the first prompt into history.xlsx. Every subsequent run advances one step: if the current folder still needs images, it returns Bool_trigger_queue = True and bumps the batch counter; when a folder's done it moves to the next prompt; when everything's done it resets and returns False. You keep re-queuing the workflow until the boolean flips - that's the loop.

    The inputs that matter:

    • mode_type - a string, ab or d. It selects the base folder and the Excel sheet. This is where the wheels come off for most people, read below.
    • Num_of_Prompts (0–30), image_per_Prompt (1–30), batch_size (1–30) - the job spec: prompts, images each, images per sampler run.
    • seed and prompt (multiline) - the seed feeds the prompt generator; your typed prompt is only used when Num_of_Prompts is exactly 1.

    Outputs: Bool_trigger_queue (keep going or stop), folder_path (the current numbered folder, or no-data when there's nothing to save yet - that magic string is what abyz22_SaveImage recognizes), prompt, cur_prompts, cur_batch, and debug for watching the state machine tick.

    Now the part that will actually bite you - and this is straight from the repo, not a rumor:

    1. prompts_maker.py is gitignored and not shipped. Whenever Num_of_Prompts is greater than 1 (or is 1 with an empty prompt), the node calls prompts_maker.make_prompt() - which doesn't exist on a fresh clone. You'll get an AttributeError. To use it at all, you must either write your own prompt generator or keep it at one prompt with a typed prompt.
    2. Hardcoded Windows paths. The base folders are literally E:/ComfyUI/output/submit1/ (mode ab) and E:/ComfyUI/output/submit3/ (mode d). On Linux, Mac, or any different layout, os.listdir throws on the nonexistent path. You'll be editing set_queue.py before this runs anywhere but the author's machine.
    3. The Excel file must already exist. It loads E:/ComfyUI/output/history.xlsx and expects sheets literally named Sheet1,2 and Sheet4, then writes prompts by row-index math (row = highest_num + cur_prompts + 4). No file, no run. The openpyxl dependency in the pack's requirements is there for exactly this.

    Bottom line: this is a genuinely clever reference for building a stateful batch loop in ComfyUI - the counter state, the folder-per-prompt scheme, the "signal to re-queue" pattern are all worth stealing. But it's a personal rig published as-is, not a product. Treat it as a template to adapt, not something to install and go. If you just want to batch through prompts, Impact Pack's wildcard encoder or plain ComfyUI queueing gets you most of the way there with a fraction of the setup. Install it with the pack (Manager → image_control, or git clone https://github.com/abyz22/image_control into custom_nodes/), and expect to spend an evening making it yours.

    Categoryabyz22

    Inputs (6)

    NameTypeDefaultDescription
    mode_typeSTRINGab
    Num_of_PromptsINT10–30
    image_per_PromptINT241–30
    batch_sizeINT11–30
    seedINT11–18446744073709550000
    promptSTRING

    Outputs (6)

    NameTypeDescription
    Bool_trigger_queueBOOLEAN
    folder_pathSTRING
    promptSTRING
    cur_promptsINT
    cur_batchINT
    debugSTRING