Layer Edit
Change one thing about a layer, leave the rest alone
- layers
- layers
- index
A layer stack is only useful if you can tweak one layer without rebuilding the stack. WAS Layer Edit is the suite's all-purpose editor for a single layer in a LAYERS document: where it sits, how big it's drawn, its angle, opacity, blend mode, mirroring, name, visibility and place in the stack. The design trick that makes it usable is in the tooltip's opening line - "Every setting has a keep value, so one node changes the one thing it is set for and leaves the rest of the layer exactly as it was."
That "keep" philosophy is the whole interface. Position, for example, doesn't take effect unless set_position is true - flip it on and the layer moves to x/y; leave it false and it stays put. Same for rotation behind set_rotation and rotation in degrees (negative for a counter-clockwise lean). Why the double switch? Because a node that always wrote every value would clobber whatever came before it the instant you dropped it in a chain. With the keep semantics you can park a Layer Edit mid-pipeline that does exactly one job - turn the layer 15°, or move it to a corner - without needing to know (or re-enter) everything else about it.
The other fields mostly use a sentinel value for "don't touch": opacity defaults to -1 meaning keep (0.0 is drawn-but-invisible, 0.5 half strength, 1.0 solid); w and h default to 0 meaning keep the current drawn size (set them to force a draw size independent of the picture's own resolution); z_index defaults to -1 meaning keep, and any other value renumbers the layer into that slot from the back, shifting the rest around it. The dropdowns - blend_mode, visible, flip_h, flip_v - each have a literal keep option as their no-op, alongside their real values (multiply, screen, luminosity for blending; on/off for visibility and mirroring). And name is the rename field: blank keeps the current name, anything else renames the layer, which is what the name-matching nodes (Layer Select, Layer Order, and the other editors) then match on.
One layer is chosen per node by index (0 from the back, -1 the front) or layer_name, and the outputs are layers - the whole stack with that one layer changed, numbered from 0 at the back, for Create Layered Image or another edit - plus index, where the changed layer now sits (useful because changing z_index moves it, and downstream nodes may need the new number).
The pattern that makes this node worth learning: Layer Edit is where the suite's other operations hand off. Layer Duplicate creates a copy so this node can restyle it; Layer Align positions things so this node can fine-tune the details. You rarely edit a layer "raw" - you duplicate, offset, rename, and recolour copies into shadow, outline and highlight passes. If that sounds like Photoshop layer styles done with dataflow, it is - and Layer Edit is the primitive underneath all of it.
Install
Part of WAS Node Suite v3. ComfyUI Manager, search "WAS Node Suite", or:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui
Restart after. Needs ComfyUI 0.14.0+ and Python 3.10+. The layer system needs nothing extra installed - no pip packages, no model downloads (v3 dropped the old pack's dependency load).
Common issues
- I changed x/y and nothing moved.
set_positionis a separate switch - it has to be true for position to be written. - Layer vanished.
opacity0.0 is drawn but invisible;visibleoff hides it while leaving it in the stack. Both are legitimately useful, both look like deletions when you didn't mean them. - Edit clobbered the layer's size.
w/hof 0 is "keep"; any other value forces the drawn size. Check you're not writing unintended values from a reused node.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| layers | LAYERS | The stack holding the layer to change. Wire in Add Layer, Layer Duplicate or anything else answering a LAYERS document. | |
| index | INT | 0-16384–16384 | Which layer, counting 0 from the back of the stack. -1 is the front layer and -2 the one under it. Ignored while layer_name names one. |
| layer_name | STRING | Name of the layer to change instead of index. Blank uses index. 'sky' finds a layer called Sky, and finds Sky Backdrop where nothing is called exactly Sky. | |
| set_position | BOOLEAN | false | Whether x and y are written. 'false' leaves the layer where it is; 'true' moves it to x, y. |
| x | INT | 0-16384–16384 | Left edge on the canvas in pixels, written only while set_position is true. 0 is the canvas edge, 100 is 100px in, -40 hangs the layer off the left. |
| y | INT | 0-16384–16384 | Top edge on the canvas in pixels, written only while set_position is true. 0 is the top of the canvas, 100 is 100px down. |
| w | INT | 00–16384 | Width the layer is drawn at, in pixels. 0 = keep, 512 = drawn 512 across whatever its picture measures. |
| h | INT | 00–16384 | Height the layer is drawn at, in pixels. 0 = keep, 512 = drawn 512 tall whatever its picture measures. |
| set_rotation | BOOLEAN | false | Whether rotation is written. 'false' leaves the layer at the angle it already has; 'true' turns it to rotation. |
| rotation | FLOAT | 0.0-360–360 | Turn in degrees, written only while set_rotation is true. 0 = upright, 90 = a quarter turn clockwise, -15 = a slight lean the other way. |
| opacity | FLOAT | -1.00-1–1 | How solid the layer is. -1 = keep, 0.0 = drawn but invisible, 0.5 = half strength, 1.0 = solid. |
| blend_mode | COMBO | How the layer mixes with what is under it. 'keep' leaves the mode it has; 'normal' covers; 'multiply' darkens; 'screen' lightens; 'luminosity' keeps the colour below and takes only the brightness. | |
| visible | COMBO | Whether the compositor draws the layer. 'keep' leaves it, 'on' shows it, 'off' hides it while leaving it in the stack. | |
| flip_h | COMBO | Whether the layer is mirrored left to right. 'keep' leaves it, 'on' mirrors it, 'off' draws it the way round its picture is. | |
| flip_v | COMBO | Whether the layer is mirrored top to bottom. 'keep' leaves it, 'on' mirrors it, 'off' draws it the way up its picture is. | |
| name | STRING | What the layer is called. Blank keeps the name it has; 'sky' renames it to sky, which is what Layer Select and Layer Order then match on. | |
| z_index | INT | -1-1–16384 | Where the layer sits in the stack, 0 at the back. -1 = keep. 2 puts it third from the back and renumbers the rest around it. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| layers | LAYERS | The whole stack with that one layer changed, numbered from 0 at the back, for Create Layered Image or another edit. |
| index | INT | Where the changed layer now sits, counting 0 from the back. |