align_workspace
Align selected ComfyUI nodes along any edge or distribute them evenly without moving others, fixing untidy graphs while preserving layout.
Instructions
Line nodes up on a common edge, space them evenly, or both.
Unlike arrange_workspace this never reads a link: it moves the nodes it is given along one axis and changes nothing else about the layout. That is the point - straightening a row of loaders should not rearrange the workflow around them. Reach for this when the graph is already laid out the way the author wants and only looks untidy.
Edges account for how big each node draws, so aligning right lines up the
far edges of nodes of different widths rather than their positions, and a
collapsed node lines up by its title bar rather than by the size it reports.
Args:
nodes: the node ids to align - at least two. From get_workspace_graph.
edge: "left", "right", "top", "bottom", "centre_x" or "centre_y". The
centre forms use the middle of the whole selection.
distribute: "x" or "y" - even out the gaps between the nodes along that
axis. The outermost two stay where they are and the rest are shared
out between them; gaps rather than centres, since nodes differ in
size enough that even centres look uneven.
spacing: an exact gap for distribute, in canvas units, instead of
filling the space the nodes already span.
edge and distribute combine only across axes: aligning tops while
spreading horizontally is one intention, aligning lefts while
spreading horizontally is two contradictory ones.
apply: write the positions. False reports them without touching the
canvas; the same dict can be passed to set_workspace_layout.
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 |
|---|---|---|---|
| edge | No | ||
| apply | No | ||
| nodes | Yes | ||
| scope | No | root | |
| spacing | No | ||
| client_id | No | ||
| distribute | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||