Nodes/WAS Node Suite v3/Layers Canvas
ComfyUI Node Runs on cloud

Layers Canvas

Keep your composite at the size it's supposed to be

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Layers Canvas
  • layers
  • match
  • layers
  • width
  • height
width0
height0
anchortop left

Here's a problem you will hit the first time you composite a plate and then add a glow or a shadow to something near the edge: your 640×1137 picture silently comes back larger than the plate. That's not a bug in the effect - a layer stack with no canvas of its own sizes itself to whatever its layers reach, so the moment a stroke, glow or shadow pokes past the edge, the whole document grows. Layers Canvas is the fix: it pins the stack to an explicit size and lets effects run off the edge the way they would in a real image editor, clipped instead of inflating your canvas.

Setting the canvas

Give it the stack and a width and height in pixels. 0 means "keep whatever the stack already names" - or, where it names nothing, whatever its layers reach. So the simplest version is: feed it the plate, type the plate's dimensions, and from then on the document stays that size no matter how far an effect bleeds.

There's a smarter option: the optional match input takes an IMAGE - wire in the plate you're compositing onto and the canvas becomes exactly its size. No typing, no off-by-one between what you think the plate is and what it is. This is the wiring I'd reach for in any workflow that composites onto a loaded background.

anchor decides where the existing layers sit when the new canvas isn't the size they currently reach. top left leaves every placement as it is - the canvas grows down and to the right from the origin. centre moves all the layers so the middle of what they cover lands on the middle of the canvas. Pick centre when you've built content for a frame and are now planting it on a bigger plate; pick top left when you're pinning an exact size to content that's already placed correctly.

Outputs

You get the same stack carrying its canvas, plus width and height integers reporting what the stack now names. Those two numbers are the honest way to hand the document's dimensions to an Image Blank or a resolution node downstream instead of typing them again.

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. Requires ComfyUI 0.14.0+ and Python 3.10+; v3 installs no extra pip packages.

Where people trip

The usual confusion is expecting the canvas to crop the layers to its size. It doesn't - it sets the drawing area. A layer placed outside the canvas draws nothing there (or is clipped when the stack flattens), but nothing about the layer's own picture is destroyed. Put this node early, right after the stack is assembled, because retrofitting a canvas after an effect already grew the document means the growth has already happened - the layers downstream will re-anchor to the new pinned size, which is not always where you wanted them. Set it once, before the effects, and the "picture got bigger" class of bugs just stops existing.

CategoryWAS Suite/Image/Layers

Inputs (5)

NameTypeDefaultDescription
layersLAYERSThe stack to set the canvas on; LAYERS.
widthINT00–16384Canvas width in pixels; INT. 0 keeps whatever width the stack already names, or the width its layers reach where it names none.
heightINT00–16384Canvas height in pixels; INT. 0 keeps whatever height the stack already names, or the height its layers reach where it names none.
anchorCOMBOtop leftWhere the layers sit when the canvas is not the size they reach. `top left` leaves every placement as it is; `centre` moves them all so the middle of what they cover is the middle of the canvas.
matchoptIMAGEA picture to take the canvas from instead of typing it; IMAGE. Wire the plate being composited onto and the canvas becomes its size.

Outputs (3)

NameTypeDescription
layersLAYERSThe same stack, carrying the canvas it is drawn on; LAYERS.
widthINTThe canvas width the stack now names; INT.
heightINTThe canvas height the stack now names; INT.