build_workflow
Builds a runnable ComfyUI workflow from a template and parameters, returning JSON ready to execute or save.
Instructions
Build a ComfyUI workflow from a template and parameters. Returns workflow JSON ready to execute or save. For txt2img_flux, call get_system_resources first and use only when flux_ready is true (FLUX needs ~12GB+ VRAM).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"template": "<template>"
},
"name": "build_workflow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | No | Optional: width, height, steps, cfg, prompt, negative_prompt, seed, ckpt_name, filename_prefix, batch_size, denoise; for txt2img_flux: clip_l, t5xxl, guidance | |
| template | Yes | Template id (e.g. txt2img, txt2img_flux). Use list_templates to see available. |