arrange_workspace
Automatically rearranges ComfyUI workflow nodes into a clean left-to-right flow based on data dependencies. Untangle cluttered canvases and improve readability.
Instructions
Lay the workflow out left to right, in the order the data flows through it.
Each node is placed one column past everything feeding it, and the nodes in a column are ordered to face what they are wired to, so links run forwards and cross as little as possible. The block keeps the top-left corner it already had, so it lands where the author left it rather than at the origin.
Reaches for the whole graph by default, which is the blunt instrument: it will
move everything, and a group whose members end up far apart becomes a large
box around them. Prefer only with one group's nodes at a time - that leaves
the rest of the canvas untouched and keeps each block inside its own group.
Args: only: node ids to arrange, leaving every other node where it is. Links to nodes outside the list are ignored, since they cannot place anything. spacing_x: gap between columns, past the widest node in the left one. spacing_y: gap between nodes stacked in one column. origin: [x, y] for the top-left of the result. Defaults to the top-left of what is being arranged, so nothing wanders off. apply: write the positions. False computes and reports them without touching the canvas - the same dict can then be passed to set_workspace_layout. scope: "root" for the top level, "active" for the subgraph on screen. Not "all": a subgraph is a canvas of its own with its own coordinates, so there is no one layout that covers several. Use navigate_workspace to go in and arrange with "active". client_id: which tab to arrange; defaults to the most recently focused one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| only | No | ||
| apply | No | ||
| scope | No | root | |
| origin | No | ||
| client_id | No | ||
| spacing_x | No | ||
| spacing_y | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||