set_workspace_values
Set widget values, node properties, and on-screen labels in an open ComfyUI workflow, with validation and single-step undo. Pass multiple changes at once to edit the live canvas exactly as typed.
Instructions
Set widget values, node properties and on-screen labels in the open workflow.
This edits the live canvas, exactly as if the values had been typed in. The change lands on the frontend's undo stack as a single step, so one Ctrl+Z in the browser takes back the whole call - which is the reason to pass several values at once rather than one per call, and why properties live here rather than in a tool of their own.
Nothing is written unless every key validates, so a rejected call leaves the graph as it was. Numeric ranges are enforced; a combo value outside the listed options is reported as a note and written anyway, because a node's option list is not a whitelist - ComfyUI decides.
Args:
values: {"<node_id>.<widget>": value}, e.g. {"37.megapixels": 1.5}.
Node ids and widget names come from get_workspace_graph.
properties: {"<node_id>.<property>": value} - the second, separate set of
settings a node carries, the ones ComfyUI edits through the Properties
Panel on its context menu. Some nodes keep their whole configuration
there and their widget values mean nothing without it. A separate
argument because the two namespaces can collide: one node here has a
delimiter in both. Written through the node's own setProperty, so a
pack that rebuilds its widgets in response gets the chance to.
labels: {"<node_id>": {"title": ..., "inputs": {...}, "outputs": {...}, "widgets": {...}}} - the text drawn on a node rather than in it.
This is what makes a workflow readable in another language: a graph
written in Chinese keeps its headings in node titles, slot labels and
widget rows, and no widget value reaches any of them. Addressed by
the stable name from get_workspace_graph, and null or "" clears an
override so the name shows through again - which is how a translation
is taken back off. widgets is separate from inputs because a
converted widget has both, and only the widget's own label changes the
row on screen - but that one is not saved with the workflow and
lasts until the page reloads, which the change log says each time.
Keyed by node id alone, because a node has one title and several sets
of names, and "1.title" would collide with a widget called title.
Do not try to write localized_name: that one is ComfyUI's own
translation for the current locale and is regenerated on load.
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 | |
| labels | No | ||
| values | No | ||
| client_id | No | ||
| properties | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||