LoadImage_Preview
Browse, load, and mask your image without leaving ComfyUI
- image
- image
- mask
- filename
- JSON_info
LoadImage_Preview is the pack's image loader with a built-in editor, and if you do any inpainting in ComfyUI you'll understand why it exists five minutes after you use it. Normally you load an image, then use a separate node to draw a mask on it, and the whole thing feels bolted together. This node puts the file browser and the mask-painting canvas in the same place, so you can flip through images, pick one, paint a mask or a box, and wire it straight into your inpaint workflow.
How it works
Set folder_path (defaults to /tmp/ComfyUI/output - point it at your real image directory) and sort_method (six options: name ascending/descending, newest first, oldest first, or by modified time) and you get a browsable list of images in that folder. Pick one with selected_image and it loads into an edit panel where you can draw on it.
That edit panel is where the magic lives, and the shortcuts are worth memorizing:
- Shift + left-click draws a straight line, a square, or a circle - hold it to constrain the shape.
- L-alpha loads the image's alpha channel onto the canvas.
- Return takes you back to the image browser.
You can paint freehand masks or drop rectangular/circular regions, which covers the two classic inpaint prep tasks. There's also an optional image input added in v1.4.0, which lets you bridge edits - feed an image in rather than only loading from disk.
The outputs cover the full workflow: image (the loaded or edited image), mask (whatever you painted - the thing you actually wanted), filename (the loaded file's name, useful for saving outputs with the same base name), and JSON_info (auto-formatted metadata for the image, handy if you're scripting around it or want to round-trip prompts).
Where it comes from
The browsing code is borrowed (with credit in the README) from Enashka's ComfyUI-nhknodes image_loader_with_previews, so the file-browsing UX has real pedigree. This node wraps it in the edit panel and slots it into this pack. If you've used nhknodes, the browser half will feel familiar.
Installing it
It's part of supElement/ComfyUI_Element_easy:
cd ComfyUI/custom_nodes
git clone https://github.com/supElement/ComfyUI_Element_easy.git
Restart ComfyUI, or install via ComfyUI Manager by searching ComfyUI_Element_easy.
Gotchas
A few real ones. First, folder_path is a raw path - ComfyUI's default is /tmp/ComfyUI/output, so if your images are elsewhere you must change it or you'll stare at an empty folder. Second, earlier versions had a bug where the node could be hard to delete from the graph; it's fixed in the current release, but if you're on a stale version and the node misbehaves, update the pack before assuming you did something wrong. And remember the drawing shortcuts: freehand is fine for organic regions, but Shift for constrained shapes is what makes boxes and circles actually usable.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | /tmp/ComfyUI/output | — |
| selected_image | STRING | — | |
| sort_method | COMBO | newest_first | 6 options: name_asc, name_desc, newest_first, oldest_first, recently_modified, oldest_modified |
| imageopt | IMAGE | — | |
| mask_dataopt | STRING | — | |
| shape_dataopt | STRING | — | |
| crop_dataopt | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| filename | STRING | — |
| JSON_info | STRING | — |