ComfyUI Node

Load Image

A picker with thumbnails, and a mask that lives in its own file

By Nynxz·Created 11 months ago·Updated about 12 hours ago· 4
Load Image
  • image
  • image
  • mask

Core's Load Image node gives you a dropdown of filenames. If you have four hundred files in input/ and they're called image (37).png, that dropdown is a filing cabinet with no labels. This is the same node with a searchable, thumbnail-first picker bolted on - and one extra idea that's more interesting than the UI: the mask gets its own file instead of being baked into the image's alpha.

The picker

The widget is the pack's frontend (a Vue component, type NYNXZ_IMAGE_PICK), and it's backed by a small HTTP route the pack registers - /nynxz/images - which walks ComfyUI's input/ directory (recursively, so subfolders work) and returns every file with an image extension, sorted by name, with size and mtime. Thumbnails aren't generated by the pack at all; it points at ComfyUI's own /view?type=input endpoint, and uploads go through the stock /upload/image route, which hash-compares duplicate names instead of piling up copies.

That's a well-behaved design for a picker: no cache directory, no thumbnail generation, no second copy of your library. And the listing route takes a folder type, so it can browse temp/ and output/ too - which is handy when you want to reload something you generated a run ago.

The sidecar mask

This is the part I'd actually defend. ComfyUI's convention is that the loaded image's alpha channel becomes the mask output, which works until you want two different masks for one image, or a mask that doesn't match the alpha you want to keep for compositing. Here the widget value can be a compound JSON object - {"image": "...", "mask": "..."} - pointing at a separate grayscale file, white where masked, which gets loaded, EXIF-transposed, converted to L, resized to the image's dimensions, and returned as the mask.

The base RGB is never touched either way, and the priority order is: sidecar mask wins, then the image's own alpha, then an empty mask. That's a real convenience for iterative inpainting - you can keep portrait.png and portrait_mask.png side by side and swap masks without re-exporting the image. It also means a workflow can be honest about a mask it didn't generate.

Inputs and outputs

One input: image, the picker widget, default empty. Two outputs, exactly like core: image and mask.

The rest of the load path is deliberately identical to core's, and that's a good thing - Pillow open, EXIF transpose per frame, per-frame RGB, animated formats iterate as a batch. A 4-frame GIF comes out as a 4-image batch rather than one frame. So nothing you know about core Load Image misleads you here.

One small nicety: if nothing's picked or the file has gone missing, the node emits a 64×64 blank image and a matching blank mask instead of raising. Your graph survives a broken path with a black square rather than a red error - great while building, mildly dangerous once you're running a queue at 2am and the "why is this one black" question costs you an hour.

Installing it

Manager → search Nynxz → ComfyUI-NynxzNodes, or:

comfy node install comfyui-nynxz-nodes

From source:

cd ComfyUI/custom_nodes
git clone https://github.com/Nynxz/ComfyUI-NynxzNodes
cd ComfyUI-NynxzNodes
pnpm install && pnpm build

Restart. No models, no Python dependencies.

Troubleshooting

The picker shows as a text box, or is empty. Frontend, every time. The built Vue bundle lives in web/, which is gitignored in the repo, which means a bare git clone installs the Python and none of the UI - including the route-backed picker. The README says pnpm install && pnpm build for source installs and means it. Manager and comfy node install ship the build, so they're the path of least resistance.

An image you just uploaded isn't listed. The listing is computed server-side on request, so a refresh of the node's picker usually fixes it. If it persists, check it's actually in input/ - uploading through the picker goes through ComfyUI's own route, but dragging a file into the workflow doesn't necessarily put it there for other nodes.

The mask looks inverted. It's white = masked, which is ComfyUI's core convention, and the opposite of the alpha channel it replaces (where opaque = kept). If you're used to reading alpha, sidecar masks will feel backwards for a day.

Blank 64×64 output. Missing file, or nothing picked. Not a subtle bug - go look at the path.

CategoryNynxz/IO

Inputs (1)

NameTypeDefaultDescription
imageNYNXZ_IMAGE_PICK—

Outputs (2)

NameTypeDescription
imageIMAGE—
maskMASK—