pack_workspace_subgraph
Convert selected nodes or groups into a subgraph, or unpack a subgraph to restore its contents. Preserves existing wiring while organizing the workflow.
Instructions
Wrap nodes and groups into a new subgraph, or dissolve one back out.
ComfyUI's "Convert to Subgraph" and its Unpack counterpart. Folding a stage into a subgraph is how a workflow stops being a wall of nodes: the box keeps its own wiring, and promote_workspace_inputs decides which of its values show on the outside.
It acts on the graph on screen, so packing while inside a subgraph nests
one. Ids are the plain local ones a read of that graph reports, not the
98:12 path form - a selection only ever belongs to one graph. Use
navigate_workspace first when the nodes are a level down.
A group can be named instead of listing its nodes: it goes in along with everything inside it, which is what selecting one on the canvas amounts to.
One call is one Ctrl+Z, and unpacking happens before packing - so a single call can dissolve a subgraph and re-wrap its parts differently.
Ids do not survive either direction. Packing replaces the nodes with one new node; unpacking hands the contents fresh ids rather than the ones they went in with - measured, 144 and 145 came back out as 158 and 159. Read the graph again afterwards rather than reusing ids from before.
This is not the same as moving a node into a subgraph that already exists. ComfyUI has no operation for that; unpack the subgraph, then pack the parts together with whatever else belongs there.
Args: pack: node and group ids to fold into one new subgraph. Anything that is not one convertible block is refused by litegraph, which says nothing else, so the refusal names that. unpack: subgraph node ids to dissolve, putting their contents back into the graph on screen. A node that is not a subgraph is refused. client_id: which browser tab to act in; defaults to the most recently focused one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pack | No | ||
| unpack | No | ||
| client_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||