Nodes/ComfyLab Pack/Generic Queue (lab)
ComfyUI Node

Generic Queue (lab)

Loop a list of anything, without touching the queue size

By bugltd·Created 2 years ago·Updated about a year ago· 11
Generic Queue (lab)
  • input_list
  • index
  • value
  • index
  • total

Generic Queue (lab) is the workhorse of the ComfyLab pack: you hand it a LIST of anything - prompts, seeds, CFG values, model names, integers - and it hands one value back per execution, looping through the whole list while ComfyUI's queue keeps firing. Every item becomes one run. That's it, and "that's it" is the point.

The pitch that sold me: no counter to reset and no queue size to set. Other batch-looping setups make you increment an index, remember to reset it, or set ComfyUI's queue size to the batch length and pray. This node re-queues itself. You set ComfyUI's queue size to 1 and let the node's own loop take over - it knows when it's done, and it resets its index cleanly on completion, interruption, or error so the next run starts fresh instead of resuming at some stale position.

How it works

Each execution reads the value at the current index, outputs it, and reports progress. When the list is exhausted, the run completes and the index resets to 0. Internally it's simple - a Python list indexed by a counter - but the auto-queue mechanics around it are what make it feel magic.

Outputs:

  • value - the current item, untyped (Any). Wire this wherever the varying thing goes: a prompt, a seed, a filename, a float.
  • index - 1-based position of the current item.
  • total - length of the list.

The optional index input (QUEUE_STATUS) lets you chain queues - one queue's status can drive another, which is how the pack composes batches out of smaller batches.

The one input that matters is input_list, the LIST you want to loop. Everything else is optional.

Why you'd use it

Classic case: a "compare six prompts against one seed" workflow. Build the list with List: from Multiline (lab) (one prompt per line), feed it to the queue, wire value into your prompt text, and queue fires six times. Same pattern for a batch of CFG values or seeds - pair it with List: Random Seeds (lab) for a stable seed set across a run.

It's also the generic fallback when the XY plot's two dimensions are overkill and you just need a loop.

Install

ComfyLab Pack installs as one package (nodes display with "(lab)" suffixes). ComfyUI Manager: search ComfyLab Pack, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/bugltd/ComfyLab-Pack.git
cd ComfyLab-Pack
pip install -r requirements.txt

Restart after. No model files, light requirements - the pack is pure tooling.

Gotchas

  • Empty list = instant error. The node raises on an empty input_list rather than silently doing nothing. Annoying, but it beats a silent no-op.
  • Type discipline is on you. value is Any, so it flows anywhere - including into places where it's wrong. A string of "7.5" into a float slot will error at the destination, not here.
  • One bad iteration kills the batch. Like any long-running auto-queue, a single error mid-list stops the run. In practice, validate one short run before launching the full list - the overnight-crash-on-item-7 failure mode is real and it's exactly why people debug batch queues in the first place.
  • Don't set queue size above 1. The node manages its own loop; a bigger queue size fights it.

It's the kind of node you don't notice until you realize you haven't touched the queue size in weeks. That's the win.

CategoryComfyLab/queue

Inputs (2)

NameTypeDefaultDescription
input_listLISTlist of values, processed by queue
indexoptQUEUE_STATUScurrent queue status

Outputs (3)

NameTypeDescription
value*current value (not typed)
indexINTcurrent index
totalINTtotal elements