Layers Arrange
Position your stack by hand, in JSON, without flattening
- layers
- layers
Most of the pack's layer nodes move one layer at a time with index arithmetic. Layers Arrange is the different animal: it takes a whole arrangement as JSON and applies it in one shot - position, size, rotation, opacity, visibility and z-order, per layer - then passes the stack on unflattened. It's also the only node in the set that shows its work: it draws a panel listing the layers, and you can edit the arrangement box right on the node.
The arrangement box
The arrangement input is a JSON string keyed on layer index from the bottom:
{
"0": { "x": 64, "y": 0, "z_index": 2, "visible": false },
"1": { "x": 320, "y": 180, "rotation": 12, "opacity": 0.8 }
}
The keys inside each entry are all optional: x, y, w, h in pixels, rotation in degrees, opacity 0.0–1.0, visible, and z_index. Anything you leave out stays exactly as it arrived - this node is an edit, not a reset. That's its quiet superpower: you can change one property of one layer and leave all 200 other coordinates untouched, because only the keys you write get applied.
How do you get real coordinates without guessing? The node's panel lists the layers and writes what it changes back into the arrangement box - the description calls it out as the no-browser workflow. It's a genuine "draw on the node" deal, the sort of thing the rest of the suite does for previews. So the sane workflow is: eyeball it on the panel, let it fill the box, then tidy the JSON.
Outputs
One output: the same stack with the arrangement applied, layer 0 still at the bottom, ready for Create Layered Image, Layers to Image Batch, or another arrange further down. Because the stack is passed through rather than flattened, you can stack two Arranges - say one that positions everything and a later one that only fades layers in - and neither fights the other.
Installing it
Part of WAS Node Suite:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git
or ComfyUI Manager → "WAS Node Suite v3", then restart. Needs ComfyUI 0.14.0+ and Python 3.10+; v3 pulls no pip dependencies.
Where people trip
JSON formatting is where it breaks, and the errors are honest about it - a bad key or a trailing comma shows up as a parse problem rather than a silently ignored arrangement. Keys are the index strings "0", "1"... matching the numbering everyone in this pack uses: 0 is the bottom layer, and if a stack got reordered upstream your indices may have moved. z_index also renumbers how the stack composites, so moving a layer with z_index while other layers keep theirs can interleave things in ways index keys don't obviously predict. When in doubt, arrange with z_index per layer or leave it out and reorder with Layer Order first. And remember: an empty {} is valid and means "change nothing" - useful as a pass-through when you want the panel's readout without touching anything.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| layers | LAYERS | The stack to arrange. Wire in Add Layer, Layer Edit, Layers From Bounding Boxes or anything else answering a LAYERS document; layer 0 is the bottom of the stack. | |
| arrangement | STRING | {} | Where each layer goes, as JSON keyed on its index from the bottom: {"0": {"x": 64, "y": 0, "z_index": 2, "visible": false}}. Keys are x, y, w, h in pixels, rotation in degrees, opacity 0.0 to 1.0, visible and z_index, all optional. Anything left out stays as it arrived. The panel writes this. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| layers | LAYERS | The same stack with the arrangement applied, for Create Layered Image or Layers to Image Batch. Layer 0 is still the bottom. |