ComfyUI lesson 9: Automate batches, prompt lists, REST, CLI, and MCP
Treat workflow inputs as an API contract and keep a manifest for every batch.
Listen to this article
On-device voiceUses the voice built into your browser; no article text leaves this page.
Audio narration is not supported by this browser.
Automation starts when named inputs replace hand-edited nodes. The gallery workflow already maps prompt, negative prompt, seed, steps, CFG, width, and height, so the same graph works from web, REST, CLI, desktop MCP, or a nightly batch.
Deploy Proteus V0.4
app comfy tutorials
app comfy deploy-gallery --mode auto proteus-v04-text-to-imageThe deployment response includes an id. Put one job's values in inputs.json:
{
"prompt": "paper-cut ocean research station, soft morning light",
"negative_prompt": "watermark, text, blurry",
"seed": 4201,
"steps": 24,
"cfg": 5
}Then queue and poll it:
app comfy run DEPLOYMENT_ID --inputs inputs.json
app comfy status RUN_ID --jsonFor CuteDSL-accelerated Z-Image, deploy cute-zimage-turbo instead. It exposes prompt, seed, steps, width, and height through the same run API.
Build a batch manifest
Use one JSONL row per prompt with a stable job id, seed, workflow slug, workflow hash, and inputs. Submit rows with limited concurrency, poll with backoff, and append the run id, output artifact, duration, and error. Never generate seeds implicitly if you need a batch to resume.
REST clients use POST /api/comfy/spaces/{slug}/deploy, POST /api/comfy/{deployment}/run, and GET /api/comfy/runs/{run}. Desktop agents can call comfy_workflow_deploy, comfy_inference_run, and comfy_inference_status. The contract is the same; only the transport changes.
Run the lesson, do not just read it
- Open the tested workflow in Comfy Studio
- Download the exact API-format JSON
- CLI:
app comfy download proteus-v04-text-to-image
The gallery records model sources, minimum VRAM, custom-node requirements, and verification state beside the graph. That is the portable unit for this series.
Series progress: lesson 9 of 10. Previous: Run modern models on modest VRAM Next: Debug any broken ComfyUI workflow