Comfy Pencil Studio
Comfy Pencil Studio is a real layered canvas, not a workaround
- document
- background_image
- clip
- document
- image
- mask
- height
- roughness
- specular
- light
- metadata_json
- conditioning
ComfyUI's usual relationship with painting is round-tripping: you sketch in Krita, export, drag the file in, run it through img2img, and hope. Comfy Pencil Studio is the node that kills that trip. It opens a full-screen painting workspace in your browser - layers, brushes, blend modes, the works - and shoves the current document straight into the graph as real IMAGE and MASK outputs. If painting is part of your workflow rather than a side quest you do in another app, this is the front door to the whole Comfypencil pack.
There are five nodes in the pack, and this is the hub. It's a frontend/backend pair: a web extension (web/) provides the studio UI, while the backend (backend/) renders and stores your document. The clever bit is the PENCIL_DOCUMENT output. It's not a pile of pixels baked into your workflow JSON - it's a lightweight payload that points at your document, and the actual layer bitmaps live on disk under custom_nodes/ComfyPencil/data/documents/<document_id>/. That keeps workflow files small, which matters once you've been painting for an hour and don't want the save button producing a 300 MB JSON.
What you actually set: canvas_width and canvas_height (64–4096, steps of 8 - it resizes the document if you change them), background_mode (transparent or solid, plus background_color), and flatten_background. That last one is worth a mental bookmark: it bakes the paper tone into the image output. Leave it off if you want to composite the painting using the mask output downstream - say, feeding it into an inpaint or a compositing stack. document_id, revision, and run_token are frontend-managed internals; don't hand-edit them, or you'll confuse the studio's save state.
The outputs tell the whole story. document feeds the other ComfyPencil nodes (Import Layer, Render Document, Extract Layer, Receive Preview). image is the composite, mask is the painted alpha. Then there are four material maps - height, roughness, specular, light - which sound exotic until you realize they exist so you can paint texture support maps for 3D or look-dev workflows instead of flat color. metadata_json gives you a document summary for debugging. And conditioning appears when you wire the optional clip input and type a prompt into the split-view dock: the node encodes it for you, no separate CLIP Text Encode chain required.
Split preview is where this gets fun. Wire a downstream branch's result into a Comfy Pencil Receive Preview node, enable Split in the studio, and you can paint while watching the graph react in real time. That's a feedback loop most painters have to leave ComfyUI to get.
Install is refreshingly boring:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/Comfypencil ComfyPencil
Restart ComfyUI, hard-refresh the browser tab, and add the node. ComfyUI Manager works too - search "ComfyPencil". No model downloads, no API keys, no extra Python dependencies beyond what ComfyUI already ships, and it targets ComfyUI >= 0.16.0.
Where people get burned: your paintings live inside the pack's data folder, so uninstalling or re-cloning the pack deletes them - export .pencilstudio files for anything you'd cry over. The browser's blend preview and the backend render are close but not pixel-identical yet (the author says so in the README). And after any update, hard-refresh, or you'll be staring at a stale studio and blaming the wrong thing. Recovery drafts in browser storage soften the "I refreshed and lost an hour" panic.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| document_name | STRING | Untitled Sketch | — |
| document_id | STRING | — | |
| revision | INT | 00–999999999 | — |
| run_token | INT | 00–999999999 | — |
| split_prompt | STRING | — | |
| canvas_width | INT | 102464–4096 | — |
| canvas_height | INT | 102464–4096 | — |
| background_mode | COMBO | transparent | 2 options: transparent, solid |
| background_color | STRING | #ffffff | — |
| flatten_background | BOOLEAN | false | — |
| documentopt | PENCIL_DOCUMENT | — | |
| background_imageopt | IMAGE | — | |
| clipopt | CLIP | — |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| document | PENCIL_DOCUMENT | — |
| image | IMAGE | — |
| mask | MASK | — |
| height | IMAGE | — |
| roughness | IMAGE | — |
| specular | IMAGE | — |
| light | IMAGE | — |
| metadata_json | STRING | — |
| conditioning | CONDITIONING | — |