run_workflow
Queue a ComfyUI workflow and wait for completion to return status, node errors, output file references, and an inline preview thumbnail. Validate workflow execution and save results directly to a specified directory.
Instructions
Queue the workflow and (by default) wait for completion. Returns status, node errors if it failed, output file refs, and an inline preview thumbnail so you can SEE the result (view_output fetches full size / other outputs). wait=False returns {status: queued, prompt_id} immediately - poll get_run_status(prompt_id). Prove a workflow works before saving/delivering.
allow_invalid=True submits even when the local validator reports errors (ComfyUI is the final judge; use it if a valid graph is being wrongly blocked). save_dir (or, when empty, the configured COMFYUI_MOUNT_DIR) relocates every finished image out of ComfyUI's output tree into a folder the caller can reach, returning saved_paths - so a render is presentable in one call without a separate save_output step.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | ||
| save_dir | No | ||
| workflow_id | Yes | ||
| allow_invalid | No | ||
| return_preview | No | ||
| timeout_seconds | No |