π¨ Krita Bridge
A hot folder that turns Krita exports into a live ComfyUI input
- image
- mask
Krita Bridge is the node that turns "paint in Krita, generate in ComfyUI" from a copy-paste chore into a hot-folder loop. It has zero inputs and two outputs: it watches ComfyUI/input/krita/, automatically loads the most recently modified PNG in there, hands you the image on one socket and its alpha channel as a mask on the other. Save a new file into that folder and it's picked up on the next run.
If you've ever built an iterative workflow - sketch in Krita, export, img2img it, take the result back into Krita, refine, repeat - this removes the "where did I save it, which file do I point Load Image at" step entirely. The alpha-as-mask output is the killer feature: draw a selection in Krita as the alpha channel, export with "Save alpha channel" enabled, and the mask output gives you an inpainting region for free. That's the loop the KB's inpainting doc describes as one of the real masking surfaces in the ecosystem - Krita's canvas plus a node that consumes its exports.
How it works. On every execution it scans the krita folder, finds the PNG with the newest modification time, and compares against what it loaded last time. If the file changed, it reloads. The IS_CHANGED method returns a live timestamp, which forces ComfyUI to re-evaluate the node every run - that's the mechanism behind the "auto-update" behavior, and it's the same always-rerun trick the plumbing docs describe. For an RGBA PNG, RGB goes to the image output and alpha (0β1) to mask; for an RGB PNG you get a uniform white mask. No PNGs present? It returns a 512Γ512 black placeholder plus a white mask, so the graph doesn't error while you're mid-edit. The folder is created automatically on first use.
Outputs. image (IMAGE, RGB) and mask (MASK). Wire image into your img2img/inpaint pipeline and mask into whatever consumes masks - VAE encode for inpaint, compositing, etc.
Install.
cd ComfyUI/custom_nodes
git clone https://github.com/tetsuoo-online/Comfyui-TOO-Pack
or ComfyUI Manager β "Comfyui-TOO-Pack" β restart.
The practical setup. In Krita, set your default export folder to ComfyUI/input/krita/, export as PNG, and remember to enable "Save alpha channel" if you want masks. The KB's metadata doc is relevant here too: PNG is the only format that keeps a clean alpha channel and text chunks, so don't export JPEGs into this folder.
Gotchas. It only watches for changes on execution - there's no real-time watcher that pauses your workflow mid-run; "auto-update during generation" means the next run picks up the new file. And it keys on the newest file by mtime, so if you save two files, the newest wins. Also note the placeholder path: if the folder is empty you'll happily generate from a black 512Γ512 image, which confuses people for exactly one run. Keep a file in the folder and it's the smoothest KritaβComfyUI bridge going.
Inputs (0)
No inputs
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| mask | MASK | β |