Layers Info
Read your whole stack out as numbers and names
- layers
- document
- layer_info
- count
- canvas_width
- canvas_height
Layers Info is the diagnostic that makes a layer stack legible. It reads a LAYERS document and spills its guts: the canvas size, how many layers it holds and how many are visible, then a row per layer carrying its index, name, placement, size, angle, opacity, blend mode and whether it has a mask. The table prints right on the node, and the same figures come out as a dictionary and a list for a switch, a caption, or any node that eats data.
Nothing about it mutates the stack - it's the one read-only member of the family, which makes it safe to drop into the middle of a chain purely to see what's travelling down the wire.
What comes out
Five outputs, three of which you'll actually use:
document- the whole stack as one DICT:canvas_width,canvas_height,layers,visible,hiddenandnames. Feeds Text Dictionary Get or Dictionary to Console.layer_info- an ARRAY with one dictionary per layer, lowest first:index,name,x,y,width,height,frames,rotation(degrees),opacity,blend_mode,visible,flip_h,flip_v,has_mask,z_index. This is the one to wire into text-building nodes when you want a caption like "sky • 1024×512 • rotated 12°".count- how many layers the document holds.canvas_width/canvas_height- the stack's drawing area, in pixels, which is exactly what an Image Blank needs if you're compositing the stack over a fresh canvas.
The tooltips are precise about the gotcha: the per-layer dictionaries are one-per-layer, lowest first - index 0 in the array is the bottom of the stack, matching the numbering every other node in this pack uses.
When you'd reach for it
The "why is my composite the wrong size" hunt: wire Layers Info in front of the flatten and read canvas_width/canvas_height - if they've grown past your plate, an effect has inflated the stack and you've found your culprit (Layers Canvas is the fix). The "where did my layer go" hunt: read the layer_info array and check visible, z_index and has_mask in one place instead of rebuilding the stack to find out. And if you're building batch operations, document gives you the names list you can feed back into a name-filtered edit.
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", restart. Requires ComfyUI 0.14.0+ and Python 3.10+; no pip packages in v3.
Where people trip
The node is marked as an output node, which means ComfyUI treats it as an endpoint - that's fine for a diagnostic, but if you wire it mid-chain and wonder why nothing downstream of it runs, that's the flag at work; give the terminal slot to the node that actually finishes your graph and keep Layers Info on a parallel branch. And remember the layer order convention: array position is stacking order from the bottom, so layer 0 in the array is the back of the composite, not the top.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| layers | LAYERS | The stack to read. Wire in Add Layer, Layer Edit or anything else answering a LAYERS document. Nothing is changed. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| document | DICT | The whole document as one dictionary: canvas_width, canvas_height, layers, visible, hidden and names. Feeds Text Dictionary Get or Dictionary to Console. |
| layer_info | ARRAY | One dictionary per layer, lowest in the stack first, carrying index, name, x, y, width, height, frames, rotation in degrees, opacity, blend_mode, visible, flip_h, flip_v, has_mask and z_index. |
| count | INT | How many layers the document holds, for a switch that handles none. |
| canvas_width | INT | How wide the canvas is in pixels, for an Image Blank the stack is composited over. |
| canvas_height | INT | How tall the canvas is in pixels, read the same way. |