run_workflow
Execute a ComfyUI workflow with a workflow ID and parameters to generate images, returning results or a running job ID when completion takes longer.
Instructions
Execute a ComfyUI workflow with the specified parameters. Returns generated images.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Random seed for reproducibility. -1 for random seed. | |
| timeout | No | Seconds to wait before returning status "running" (default and max: 50). Only used when wait_for_completion=true. | |
| parameters | Yes | Workflow-specific parameters (prompt, lora_name, aspect_ratio, etc.) | |
| workflow_id | Yes | The workflow ID to execute | |
| filename_prefix | No | Strongly recommended: a clear, descriptive name for this generation that becomes the actual ComfyUI output filename (e.g. "raccoon-boardroom-ceo", "product-hero-shot-blue"). Use cohesive, human-readable markers so related images group together and are easy to find later. Reuse the same base name across a series, varying a suffix (e.g. "-v2", "-wide"), to keep a batch coherent. Avoid generic or auto-generated names. If omitted, falls back to a generic "Comfy-<workflow>" prefix, which makes outputs hard to identify. | |
| wait_for_completion | No | Wait for workflow completion (default: true). Waits at most 50s per call; longer jobs (video, cold model loads) return status "running" with a prompt_id to pass to get_job_result. If false, returns immediately. |