🎈FastCanvasComposite
Reapply a canvas layout without dragging a single layer
- bg_img
- image
- mask
- transform_data
- image
- mask
FastCanvasComposite is the "output side" of the FastCanvas family. Where FastCanvas gives you an interactive canvas and returns a composed image, this node takes a background, a layer, a mask, and the transform_data that FastCanvas emitted - and composites the layer onto the background exactly where you left it. It's how you reuse a layout you arranged once, in the full resolution your pipeline actually wants.
Here's the workflow it enables: you arrange layers in FastCanvas, get transform_data out, then run the actual heavy step (inpainting, upscaling, regenerating the layer) at high resolution. FastCanvasComposite then puts that refined layer back into the same position, scale, and rotation, masked and blended - so you're not compositing a downscaled canvas preview onto a full-res image.
The inputs that matter
bg_img(IMAGE) - the background composite target.image(IMAGE) - the layer being placed.mask(MASK) - the layer's mask; usually themaskoutput from FastCanvas, which reflects whatever layer you'd selected.transform_data(TRANSFORM_DATA) - the layout. Comes straight from FastCanvas'stransform_dataoutput.invert_mask(BOOLEAN, default false) - flip the mask before compositing, if your mask came in inverted.mode(BOOLEAN) - the interesting one.falseis "Inherit Mode": it composites using the transform data as-is, inheriting where the layer was placed.trueis "HD Restore": it recomputes the transform when your input layer is a higher resolution than what was displayed on the canvas, scaling position and scale so the bigger image lands in the same spot. Use HD Restore when you refined the layer at high resolution; use Inherit when the layer is the same resolution as what you arranged.offset_x/offset_y(INT) - nudge the final placement by pixels, handy for fine-tuning a seam or an edge.
Outputs: image (the composited result) and mask (the composited mask), so the same blend can feed a further step.
How it works under the hood
The transform data stores each layer's center, scale, angle, and dimensions, plus the background size. The node turns the layer tensor into a PIL image, applies the transform (with the angle/scale/center math), and pastes it over the background with the mask. HD Restore mode rescales the transform's scale factors proportionally to the actual layer resolution - which is the fix for the classic "the canvas said 512, my upscaled layer is 2048" mismatch.
Installing it
Part of Comfyui_LG_Tools:
cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/Comfyui_LG_Tools.git
pip install -r requirements.txt
Or ComfyUI Manager → "Comfyui_LG_Tools" → restart. It's under Add Node → 🎈LAOGOU → Canvas.
Common issues
- The layer lands in the wrong spot. You're probably feeding a transform from a different canvas or resolution. Regenerate the transform_data from the same FastCanvas that arranged the layout, and if the layer resolution differs, use HD Restore mode.
- Nothing to composite. This node needs real transform_data; if you disconnect FastCanvas and hand it garbage, it has no position to work from.
- It's Chinese-first. Same pack-wide UI language situation; the node name carries the 🎈 so it's easy to spot.
It's the quiet workhorse of the canvas trio: FastCanvasTool feeds the canvas, FastCanvas arranges, FastCanvasComposite re-places at full resolution. Learn all three together and you've got a genuinely usable compositing loop.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| bg_img | IMAGE | — | |
| image | IMAGE | — | |
| mask | MASK | — | |
| transform_data | TRANSFORM_DATA | — | |
| invert_mask | BOOLEAN | false | — |
| mode | BOOLEAN | false | — |
| offset_x | INT | 0-1000–1000 | — |
| offset_y | INT | 0-1000–1000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |