add_node
Add a node to a ComfyUI workflow with auto-connection of typed inputs. Specify node class and input values or connections to modify workflows programmatically.
Instructions
Add a node to a workflow with auto-connection of typed inputs.
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": {
"workflow_id": "<workflow_id>",
"class_type": "<class_type>"
},
"name": "add_node"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inputs | No | JSON string of input values/connections. Values: {"text": "a cat", "seed": 42} Connections: {"clip": ["1", 1]} (links to node "1", output index 1). | {} |
| class_type | Yes | Node class name (e.g. "CLIPTextEncode", "KSampler"). | |
| workflow_id | Yes | The workflow to modify. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||