batch
Run multiple ComfyUI workflows as a single durable batch, with actions to submit, check status, collect outputs, and wait for completion.
Instructions
Run MANY ComfyUI workflows under one durable batch_id. Driven by the action parameter:
action:"submit" — Enqueue a batch. Provide EITHER
workflows(array of API-format workflows) OR oneworkflowplus asweep(array of flat input-override sets — each set produces one job, applied to every node that already has that input, like create_workflow (action:"modify")). Reuses the enqueue_workflow path (seeds re-randomized unless disable_random_seed). Returns { batch_id, count, prompt_ids }; the mapping is persisted to disk and stays valid across server restarts.action:"status" — Per-job status for
batch_id: each prompt_id's state (pending/running/done/error/unknown) plus rollup counts and all_terminal. Same status source as queue (action:"status").action:"output" — Collected outputs for the batch's COMPLETED jobs: for each done prompt_id, the raw ComfyUI history
outputs(node id → images/videos/audio filenames, same data get_history reports — feed filenames to get_image action:"get"). Jobs still pending/running are listed with their state; errored jobs carry the error message. Safe to call before the batch finishes.action:"wait" — Block until every job is terminal (done or error) or
timeout_selapses, then return the same rollup as action:"status" plus timed_out/waited_s. Default timeout 300s, hard cap 600s — it can never hang; if timed_out is true, call it again or poll action:"status". Batch ids are durable — they survive server restarts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sweep | No | action:"submit" — param sweep: one job per override set, e.g. [{"cfg":6},{"cfg":8,"steps":30}]. Each key is set on every node that already has that input. | |
| action | Yes | Which batch operation to perform. "submit" takes workflows | workflow+sweep; "status"/"output"/"wait" each require `batch_id` ("wait" also takes `timeout_s`). | |
| batch_id | No | The batch_id returned by action:"submit". Required for actions "status", "output" and "wait". | |
| workflow | No | action:"submit" — one base workflow in API format, used with `sweep`. | |
| timeout_s | No | action:"wait" — max seconds to wait (default 300, hard cap 600). | |
| workflows | No | action:"submit" — array of ComfyUI workflows in API format (node ID -> {class_type, inputs}). Mutually exclusive with workflow+sweep. | |
| disable_random_seed | No | action:"submit" — if true, do not randomize seed values (default randomizes per job). |