Edit with Krita
Pause the workflow, fix the image in Krita, hit save
- images
- edited
The classic problem: the model gets a hand wrong, and you don't want to regenerate it, you want to fix it. In the old days you'd export the image, paint over it in Krita, re-import, and rebuild the workflow around the edit. Edit with Krita kills that dance - it stops the workflow mid-run, hands you the current frame, and picks back up the instant you save in Krita. The author's own framing says it all: it's for inpainting workflows where you want to make a small manual edit "to nudge the inpaint in the right direction."
It's a human-in-the-loop node, and it's about the only one of its kind. Plenty of plugins let you run ComfyUI from inside Krita (Krita AI Diffusion is the famous one). This goes the other direction - ComfyUI stays in charge, and Krita is just your paintbrush for one step. No AI, no model files, no GPU. Just a pause button with a canvas attached.
How it works
The mechanism is simpler than the install suggests. The node writes the image out as a temp PNG into a folder inside Krita's plugin directory, then sits in a loop checking the file's modification time. A tiny Krita plugin (wait_and_open) polls that same folder, and the moment a new PNG appears it opens it in Krita. When you save, the file's mtime changes, the node reads it back, deletes the temp file, and the workflow continues. Nothing clever - filesystem polling and a file's modification timestamp are doing all the work. That's also where every gotcha below comes from.
If you send a batch of images, they open one at a time. If Krita isn't running when the node fires, the workflow just waits patiently until you launch it, then the image opens. And if you do nothing, you haven't deadlocked the queue - after the timeout the original image passes through untouched.
The inputs that matter
There are only three, and they're all required, though two are fire-and-forget:
- images (IMAGE) - whatever you're editing, straight into the node.
- active (STRING) - leave it blank (or whitespace) and the node is a pure passthrough; put any text in and it runs. Great for toggling the whole detour on and off without rewiring the graph.
- timeout (INT, default 300, min 10) - seconds to wait for you before giving up and passing the original through. There's no "off" - the minimum is 10 seconds, so it always eventually yields.
One output, edited (IMAGE), which you wire back into whatever comes next - a low-denoise inpaint or img2img pass to blend your manual touch, for instance.
Installing it
You need two things: Krita itself (free, from krita.org) and the node. ComfyUI Manager handles the node - search "cg-krita" - or do it by hand:
cd [...]/ComfyUI/custom_nodes
git clone https://github.com/chrisgoringe/cg-krita
Restart ComfyUI. On startup the node tries to drop its wait_and_open plugin into APPDATA/krita/pykrita, and you should see in the console something like "Edit with Krita files installed. You may need to restart Krita." If you don't, Krita probably isn't installed or isn't on the path it expects - the README's docs/trouble.md walks through installing the plugin manually via Krita's Settings → Manage Resources → Open Resource Folder.
Where people get burned
- You must actually change the image before the timeout. The node checks modification time, not content. If you open it and save without touching a pixel, nothing happens until the timer runs out.
- The modification-time trick is fragile on slow disks. The README warns that on a slow hard drive or with very large images you can get the wrong (unmodified) file read back. If that happens, bump
PAD_TIMEindefault.txt(copydefault_example.txt, uncomment, rename). It's a blunt instrument, but it works. - Restart order. After the node auto-installs the plugin you may need to restart Krita before it picks it up, and the plugin's
log.txtappearing in its folder is the sign it loaded.
Is it overkill? If you only edit after a run, copy-paste between ComfyUI's image viewers and Krita is enough, as one r/comfyui commenter pointed out. The whole point of this node is editing during execution - when a hand comes out wrong and you want to nudge the mask-based inpaint, not reroll the image. For that, there's nothing else quite like it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| active | STRING | if this is blank, don't run | leave blank (or just whitespace) to disable |
| timeout | INT | 30010–100000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| edited | IMAGE | — |