edit_graph
Batch-edit a ComfyUI workflow graph by creating, deleting, moving, resizing, setting, connecting, or disconnecting nodes in ordered operations, with created node IDs available for chaining.
Instructions
Edit workflow graph with batched operations. Actions: create, delete, move, resize, set, connect, disconnect. Operations execute in order; 'create' returns node_id for chaining.
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": {
"operations": "<operations>"
},
"name": "edit_graph"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operations | Yes | Operation(s). Each has 'action' + params. Actions: create {node_type, pos_x, pos_y, title, ref, place_in_view}, delete {node_id or node_ids}, move {node_id, x, y} or {node_id, relative_to, direction, gap}, resize {node_id, width, height}, set {node_id, property, value} or {node_id, properties: {k:v}}, connect/disconnect {from_node, from_slot, to_node, to_slot}. Use 'ref' in create to reference node in later ops. Use 'place_in_view: true' to position new nodes at the center of the user's current viewport (nodes are offset horizontally to avoid overlap). |