Painter Image Load
Paint a mask on an image ComfyUI just generated — no save-and-reload dance
- image
- IMAGE
- MASK
You know the loop. You finish a generation, spot one thing you'd like to fix - a hand, an artifact, a stray object - and then it's Export Image → find the file → Load Image → open the mask editor → paint → wire up the inpaint chain. PainterImageLoad exists to kill the middle of that dance. It's ComfyUI's stock Load Image node with one trick Load Image won't do: it accepts an IMAGE from upstream, saves it for you, previews it, and hands back a mask you can paint directly in the built-in mask editor.
The pack is tiny and honest about it: one node, one commit, MIT, no model downloads, no requirements.txt. It only uses things ComfyUI already ships (folder_paths, node_helpers, torch, PIL), so install is as painless as custom nodes get. Credit where it's due: it comes from a Douyin (TikTok China) creator who goes by 绘画小子 ("Painter Boy"), and the README is Chinese. None of that matters at runtime - it's one box with two outputs - but set expectations: this isn't a battle-tested ecosystem, it's one person's scratch that solved a real friction point.
How it works
The node has two modes, and which one you're in changes everything:
- Stream mode - the optional
imageinput is connected. It converts the incoming tensor to a PIL image, saves it into yourComfyUI/inputfolder under whateverimage_nameis set to, and returns that same tensor unchanged as the IMAGE output. The clever part is hidden inIS_CHANGED: it returns an md5 hash of the actual incoming tensor, so ComfyUI re-runs the node and refreshes the preview every time the upstream image changes. Without that, the node's result would be cached and the preview would go stale - this is what makes the "paint it live" workflow possible. - File mode - no
imageinput. It just loads whatever file you picked, like the stock Load Image.
Either way, the MASK output is read from the saved file's alpha channel as 1 - alpha/255. Paint a region in the mask editor and it lands in the alpha channel as transparency, which comes back out as a mask value of 1 - i.e. "edit here." That's the same convention every ComfyUI inpaint node expects, so you can wire MASK straight into VAE Encode for Inpaint or Set Latent Noise Mask.
The inputs and outputs that matter
Only two inputs, both obvious:
image_name(required) - a dropdown of files already in your input folder. It doubles as the filename the node writes to in stream mode. Treat it as a scratch label: pick a name you don't care about.image(optional IMAGE) - the live upstream image. Connecting it is what activates streaming mode and the whole point of this node.
Outputs: IMAGE (your image, passthrough in stream mode) and MASK (0–1 float, 1 = painted region). Downstream you'll want IMAGE into your inpaint conditioning and MASK into the mask input - and honestly, remember to composite the result back onto the original with ImageCompositeMasked afterward, per the standing best practice.
Installing it
ComfyUI Manager → search "PainterImageLoad" (or the pack title), install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/princepainter/ComfyUI-PainterImageLoad
# restart ComfyUI
That's it. No models to fetch, no pip installs, nothing to configure.
Gotchas worth knowing
- It writes into your input folder and overwrites the selected file on every stream run. Point
image_nameat a real file and it gets clobbered. Always use a throwaway name. - No alpha + no paint = an all-zero mask. If your source image has no alpha channel and you skip the mask editor, MASK comes out as zeros and nothing gets inpainted. You have to paint.
- The mask editor's save can miss this node on current ComfyUI. The modern editor persists your paint as a fresh
clipspace-painted-masked-*.pngin the input folder and then rewires the node'simagewidget - but this node's filename widget is calledimage_name, so that auto-rewire finds nothing. After saving, check theimage_namedropdown is pointed at the painted file, or the "instant effect" the README promises won't happen on your version. The node's design assumes the mask lands back in the file it reads, which is how ComfyUI's older mask editor worked in place. - White masks, black keeps. Mask value 1 is what changes; if your inpaint is touching everything, your mask is inverted.
If you only ever mask-edit a file that already exists, stock Load Image does all of this. Reach for PainterImageLoad when the image you want to fix is still inside the graph - that's the one thing it genuinely makes faster.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image_name | COMBO | 1 options: example.png | |
| imageopt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |