Reference Image (old id)
LibraryImage is Reference Image wearing its old name — plus a mask output you'll actually use
- image
- mask
LibraryImage is the node id this pack used before version 0.1.2, when everything was renamed from Library* to Reference*. Its display name says it out loud: Reference Image (old id). If a workflow you downloaded has one, load it and queue it - it runs exactly like the current node, because in the source it is the current node with a flag set:
class LibraryImage(ReferenceImage):
DEPRECATED = True
That DEPRECATED flag only hides it from the node search, so people add the fresh name instead. Nothing about the behaviour changed.
Why this node exists at all
Load Image reads from ComfyUI/input. That's fine until your reference images live somewhere sane - a character folder, a shared drive, the output of some other tool - at which point you're copying files into input and keeping two copies in sync. This node takes a full path instead, and on top of that it does two things core Load Image doesn't bother with.
First, the name field turns into a @tag. Type @Alex in a Reference Prompt and this exact file gets wired into a model's next free image input when you queue. That's the pack's whole reason for existing: reference-driven editing with Nano Banana, Seedream, GPT Image, Qwen Image Edit and friends is now the mainstream way to keep a character consistent - the model looks at your image while it works instead of re-inventing the face - and once you're feeding three or five references per prompt, hunting for the right Load Image wire gets old fast.
Second, it hands you a mask. More on that below, because it's the quietly useful part.
Inputs and outputs
image_path- "Full path to an image file anywhere on disk." Absolute. There's aBrowse…button that fills it via a native dialog, and picking the file auto-fillsnamewith the file stem (and retitles the node@stem) unless you've typed your own name.name- "Tag used as @name in the prompt. Empty = file name without extension." So a blank name is not an error;Night_Forest.pngjust becomes@Night_Forest.
Two outputs:
image(IMAGE) - the pixels, converted to RGB, 8-bit, EXIF-rotated. Wire it into a model's image input, a Reference Prompt'simage_1, or anything downstream.mask(MASK) - the file's alpha, inverted (1.0 - alpha), which is ComfyUI's convention: white means "keep". A PNG with no alpha channel returns an all-zero mask at the image's size, so the wire is never None and you can build mask math without branching.
The loader reads every frame of a multi-frame file (animated PNG, GIF, WebP, MPO) and returns them as a batch along one image output. Frames that don't match the first frame's dimensions get skipped rather than crashing the run - a small mercy when someone hands you a hand-optimised GIF.
It also participates in ComfyUI's cache properly. IS_CHANGED returns a fingerprint of path + mtime + size, so replacing Alex.png with a new render re-runs the loader, and not touching it means the downstream graph can stay cached. Plenty of loaders get this wrong.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/PixelMonkey77/comfyui-reference-library
Restart ComfyUI, or install the same URL through ComfyUI Manager (Install via Git URL). Zero dependencies, zero model files - the pack uses only torch, numpy, Pillow, PyAV and aiohttp, all of which ship with ComfyUI.
Required: Settings → Comfy → Nodes 2.0 → Modern Node Design (Nodes 2.0). The pack targets ComfyUI's newer node frontend and doesn't work on the classic canvas. That's the honest cost of using it.
Things that go wrong
"Full path" means full path. Alex.png alone is refused - you'll get a message suggesting D:\Pictures\cat.png instead. Windows "Copy as path" quotes are stripped for you, and ~ expands.
Files in a new folder fail until you touch them once. The loader only reads folders the pack has used before: ones you picked a file in, ones holding library files, and ComfyUI's input/output. That guard is deliberate - without it, a shared workflow could name any file on your disk and ship it to a paid API. Pick the file with Browse… once and the folder is trusted from then on. (Same reason library changes only work when ComfyUI is open at http://127.0.0.1 or localhost; on --listen machines you can browse names, not folders.)
The alpha mask surprises people. It's inverted on purpose, and it's the file's alpha - not a segmentation of the subject. If your reference PNG was flattened on export, the mask output is all zeros and that's not a bug.
For new work, add Reference Image - same node, current id, and the one the docs and future updates describe.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image_path | STRING | Full path to an image file anywhere on disk. | |
| name | STRING | Tag used as @name in the prompt. Empty = file name without extension. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |