Pause To Mask
Hit pause, paint a mask in Krita, and keep the run going
- images
- images
- mask
- mask_inverted
Pause To Mask is a pause button that lives inside your graph. Drop it after your first KSampler, and when the run reaches it, ComfyUI stops, writes the current image to disk, and hands you a couple of UI buttons: open it in Krita (or your system editor), paint where you want changes, then hit Continue and let the rest of the workflow run on the mask you just drew. Cancel aborts the whole thing.
This is the "draw the mask by hand, mid-run" workflow that otherwise means building a separate inpaint graph, saving an image, painting it, loading it back. The node collapses all of that into one execution. It's a fork of Cordux's older ComfyUI-ImagePreviewPause, with the editor integration and alpha-as-mask logic bolted on.
What it actually does - and one honest gotcha
When the node fires it saves each input frame as an RGBA PNG into ComfyUI/input/clipspace/, then blocks. While paused, a background thread polls those files' modification times every 2 seconds and pushes the updated image to the ComfyUI preview, so you see your Krita edits appear live in the graph. Continue and the node reads the alpha channel of your edited file back and turns it into a mask.
The mask convention is mask = 1.0 - alpha. In ComfyUI masking that means transparent areas become white (the region that gets affected/inpainted) and painted areas become protected. You get both mask and mask_inverted out, so you don't have to flip it yourself.
Here's the part the marketing skips: your RGB edits don't come back. The node reads only the alpha channel - the images output is the original input, untouched. So Pause To Mask is a mask-maker, not an image round-trip. The workflow it feeds is an inpaint or edit step that regenerates the masked region; your Krita strokes are guidance for where, not what. If you want your painted pixels themselves in the output, this node isn't that tool. Worth knowing before you spend an hour painting in Krita expecting the result to carry over.
The inputs that matter
There are only two, which is the point - nothing to tune while a run is paused:
images(IMAGE) - whatever you're generating; the current latent decoded through a VAEDecode, or a loaded image.auto_refresh(BOOLEAN, defaulttrue) - live preview polling while paused. The interval is a fixed 2 seconds. If your workflow's busy and the thumbnail thrashing bugs you, flip it off; the preview just updates when you hit Continue instead.
Outputs are images, mask, mask_inverted (both masks as MASK). Wire mask into a Mask-to-Image/InpaintModelConditioning stack or a mask-combining node like anything from Impact Pack - the KB's inpainting guidance still holds: masked inpainting earns its keep where you need bit-identical unmasked pixels and exact placement, even as instruction-edit models ate most of the rest of the job.
Installing it
Standard custom-node fare. Either open ComfyUI Manager and search comfyui-pauseToMask, or:
cd ComfyUI/custom_nodes
git clone https://github.com/igoon4jesus/comfyui-pauseToMask
Restart ComfyUI. That's the whole install: the pack ships no dependencies beyond what ComfyUI already has (torch, numpy, Pillow, aiohttp - all present), and it downloads no models.
Krita is optional and external. Set KRITA_PATH to force it, otherwise the node falls back to whatever the OS opens PNGs with:
# Windows (PowerShell)
setx KRITA_PATH "C:\Program Files\Krita (x64)\bin\krita.exe"
# Linux / macOS
export KRITA_PATH=/usr/bin/krita
Restart ComfyUI after setting it.
Where people get burned
- The file is in
ComfyUI/input/clipspace/, not a fancy temp dir. If you're hunting for your exported PNG, it's there, timestamped with the node id. - No editor opens. That's the
KRITA_PATHfallback failing - usually a headless box with no GUI handler. Set the variable, or just open the PNG yourself. - A dead file silently means an empty mask. If the edited PNG can't be read on Continue, the code catches it and returns a zero mask (nothing masked) rather than erroring - which can look like a no-op run. If your inpaint step does nothing, check the file's still there.
- "Pause" feels like a hang. It is - that's the feature. Cancel is the abort; if the node id got orphaned, the
/api/pause_to_mask/cancelroute interrupts processing.
Given the pack's footprint is tiny, be a little careful the same way you would with any custom node: it runs arbitrary code on load, so glance at the repo before trusting a workflow that embeds it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| auto_refresh | BOOLEAN | true | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| mask | MASK | — |
| mask_inverted | MASK | — |