set_workspace_links
Wire or unwire nodes in the live ComfyUI workflow canvas. Connect outputs to inputs, disconnect existing links, and replace occupied inputs in a single undo step.
Instructions
Wire and unwire nodes in the workflow open in the browser.
Both lists are applied in one undo step, disconnects first, so moving a link from one input to another is a single Ctrl+Z rather than a half-wired graph between two calls.
An input holds one link, so connecting to a taken input replaces what was
there - the response says what under replaced. Type compatibility is checked
before anything is written: litegraph refuses a mismatched connection by doing
nothing at all, which would otherwise leave a batch half-applied in silence.
Args:
connect: [{"from": "<node_id>.<output>", "to": "<node_id>.<input>"}].
Slots may be named ("8.IMAGE", "9.images") or given by index ("8.0").
disconnect: inputs to clear, ["<node_id>.<input>"]. Only inputs - an
output feeds many links, so "which one" would be ambiguous; clear the
input end instead.
scope: "root" for the whole workflow, "active" for the subgraph on screen.
client_id: which tab to edit; defaults to the most recently focused one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | root | |
| connect | No | ||
| client_id | No | ||
| disconnect | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||