Nodes/ComfyUI-nhknodes/🎨 Edit with Krita (nhk)
ComfyUI Node

🎨 Edit with Krita (nhk)

Round-Trip a Frame Through Krita Mid-Workflow (Edit with Krita, nhk)

By EnashkaΒ·Created 12 months agoΒ·Updated 28 days agoΒ· 23
🎨 Edit with Krita (nhk)
  • image
  • IMAGE
β—„timeout300β–Ί
β—„enabledtrueβ–Ί
β—„edit_directory/home/nhk/workspace/editingβ–Ί
β—„notifytrueβ–Ί

The Edit with Krita (nhk) node is ComfyUI's version of "I'll fix this one in Photoshop": it takes your generated image, hands it off to Krita, pauses the workflow while you paint or fix it by hand, then pulls the edited file back in and keeps going. It's the bridge between "AI got 95% there" and "the fingers are wrong and I want to draw them properly."

The killer use case is an editing loop: generate β†’ send to Krita β†’ touch up β†’ feed the result back into img2img, inpainting, or a Flux/Klein edit pass for another round. Pure generative pipelines can't see your fixes; this node makes them the next prompt's input.

How it works

On execution it saves your image tensor to a file like comfy_edit_<timestamp>.png inside edit_directory (default /home/nhk/workspace/editing, a path that screams "the author's home dir" - you'll want to change it), then tries to launch Krita with that file. It walks a list of launch strategies: a hardcoded AppImage path first, then the krita binary on your PATH, then Flatpak (flatpak run org.kde.krita), then a plain xdg-open as a last resort. If notify is on it fires a notify-send desktop notification so you know the ball is in your court.

Then it polls the file's modification time every half second until you save over it in Krita, or until timeout seconds pass - whichever comes first. The file you edited is loaded back as a tensor and returned. No edit within the timeout and you get the original image back, so a hung session doesn't brick your queue.

The inputs and outputs

  • image - the frame or batch to edit. Batches are processed one image at a time, which means each one is a separate Krita round-trip. Keep batches small.
  • timeout - seconds to wait, 10 to 3600, default 300. Generous, but if you're doing detailed paintovers you may want more.
  • enabled - flip this off and the node becomes a plain passthrough; handy for testing the workflow without stopping to edit.
  • edit_directory - where files land. Change the default; it points at the author's machine.
  • notify - desktop notification via notify-send (Linux).

Output is a single IMAGE, ready to feed into whatever comes next.

Installing it

Same as the whole pack - ComfyUI Manager, search "NHK Nodes", or:

cd ComfyUI/custom_nodes && git clone https://github.com/Enashka/ComfyUI-nhknodes

and restart. The real prerequisites are Krita itself (AppImage, system install, or Flatpak all work) and a writable directory. Note the launch list is very Linux-centric; on Windows you'll likely rely on the xdg-open fallback failing and opening the file manually - which still works, because the node only cares that the file gets saved.

Where people get burned

  • The default directory. /home/nhk/workspace/editing won't exist on your box. Set edit_directory to something you own, or the node will just create it anyway (it does mkdir -p, so it won't crash - but you'll have a mystery folder).
  • Expecting an "accept edits" step. The node treats any save of the file as "edits done," including the original untouched save Krita may write. If your edit comes back unchanged, that's likely why.
  • Timeout behavior. If you miss the window you get the unedited image back, silently. If your paintovers are slow, bump timeout before you start.
  • It's a blocking node by design. The queue genuinely pauses while you edit. That's the feature, but it means this belongs in interactive sessions, not overnight batch runs.
Categorynhk/image

Inputs (5)

NameTypeDefaultDescription
imageIMAGEInput image or batch to edit
timeoutINT30010–3600Maximum time to wait for edits (seconds)
enabledoptBOOLEANtrueEnable/disable editing - when disabled, image passes through unchanged
edit_directoryoptSTRING/home/nhk/workspace/editingDirectory where images are saved for editing
notifyoptBOOLEANtrueShow desktop notification when ready to edit

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”