Canvas Node
The ComfyUI node that is secretly a mini Photoshop
- input_image
- input_mask
- image
- mask
Every now and then a ComfyUI node shows up that isn't really a node at all - it's a whole program wearing a node's jacket. CanvasNode from the Comfyui-Ycanvas pack is one of those. Open it up and you get a genuine image editor: layers with reordering and opacity, rotate/scale/mirror transforms, a lasso tool, a pen-path cutter, and one-click AI matting. When you save, it hands your graph back a composited image and its alpha as plain IMAGE and MASK tensors. Photoshop-lite, embedded, no round-tripping through a pixel editor.
What this actually is
Manual compositing in ComfyUI usually means a miserable relay: generate, export, cut out the subject in an external editor, reimport, rebuild the mask. CanvasNode collapses that loop into one node you can edit directly in the browser. The typical flow: generate an image, feed it into the optional input_image socket, open the canvas, cut out the subject (lasso, pen path, or the one-click matting), arrange it over a background, hit save - and the node spits out the finished composite plus a matching mask.
It shines when you're doing hands-on, per-image work: swapping a background, dropping a cutout onto a scene, or preparing a precise mask for inpainting. It's not a batch tool.
How it works
The clever bit is that the graph is not where the work happens. The canvas is a browser-side editor shipped with the pack; the Python side is mostly a bridge. When you save, the frontend composites every layer onto a white canvas, uploads it to ComfyUI's input folder under the name in the canvas_image field (default canvas_image.png), and writes a sibling <name>_mask.png - white where layers are opaque, black where they're transparent. On execution the node just loads those two files and converts them to tensors.
The optional input_image and input_mask sockets let a generation flow in: run once and the node caches it server-side; then Import Input pulls it down. The AI matting is a separate server endpoint that loads ZhengPeng7/BiRefNet - the segmentation model that displaced rembg as this ecosystem's default cutout - straight from HuggingFace on first use.
The inputs and outputs that matter
Only a few of these will you actually touch:
canvas_image- the filename the composite saves to and loads from. Change it if you run more than one canvas node in a workflow, or they'll clobber each other's files.trigger- a hidden integer counter for workflow sync. Bump it to force a re-run when the canvas hasn't otherwise changed.output_switch- toggles the outputs off entirely.cache_enabled- the server-side in-memory cache the Import Input flow relies on. Leave it on.
Outputs are image (IMAGE) and mask (MASK), wired anywhere you'd use that pair - inpainting, a VAE encode, further compositing.
Installing it
ComfyUI Manager → search Comfyui-Ycanvas, or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/yichengup/Comfyui-Ycanvas
cd Comfyui-Ycanvas
pip install -r requirements.txt
Restart ComfyUI and refresh the browser. The dependencies are all things ComfyUI already ships - torch, numpy, Pillow, transformers, aiohttp - so there's no heavy install. The real download is BiRefNet, fetched on your first matting click into ComfyUI/models/BiRefNet/. That's a couple of GB; if the auto-download fails, the README has manual Google Drive and Baidu links.
Where people get burned
- The canvas lives in the browser. Close the tab without saving and your edits are gone.
- Move a layer after drawing its lasso mask and the mask stops lining up - the README warns you, but you'll believe it after losing one selection.
- Import Input reports "no data" if you haven't run the workflow once - it pulls from the node's execution cache, which is empty until the first run.
- Matting silently fails when the model didn't land in
models/BiRefNet/or you're out of VRAM. - Keep canvases around 512–1024 and layers under ~20 - it thrashes on huge canvases.
Should you reach for it?
This is a young, niche pack - Google has barely seen it yet (7 impressions on its comfy.icu page), so you're an early adopter by default. If you do serious manual compositing inside ComfyUI, the edit → save → tensors-out loop is genuinely nice, and the one-click matting is good on hair and fur. One honest caveat: ComfyUI core shipped its own native BiRefNet nodes in mid-2026, so matting isn't the differentiator anymore - the canvas is. The author, yichengup, is a known name in the FLUX Fill scene (they maintain the popular flux.1-fill-dev-OneReward repo on HuggingFace), so there's a competent hand behind it - but it's a one-person effort with real rough edges. Grab it if you live in the graph and hate leaving it to touch up pixels. Otherwise, ComfyUI's built-ins plus a dedicated matting pack get you most of the way with less ceremony.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| canvas_image | STRING | canvas_image.png | — |
| trigger | INT | 00–99999999 | — |
| output_switch | BOOLEAN | true | — |
| cache_enabled | BOOLEAN | true | — |
| input_imageopt | IMAGE | — | |
| input_maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |