Load Image Info (NH)
Load an image and get its filename and path out the other side
- image
- mask
- file_name
- path
ComfyUI's built-in Load Image gives you the pixels and nothing else. Load Image Info (NH) (class NH_LoadImageInfo) is the version that also hands you the file_name and path as strings - which sounds minor until you want to name your outputs after the source, log where an image came from, or route by filename. It's the metadata-aware loader the pack's README points at, and it's the natural front end for the NH loading family.
How it works
It's a straight port of the core Load Image behavior - file picker, alpha channel handling, EXIF transpose - with two toggles that shape the string outputs:
- filename_extension (default true) - whether
file_nameincludes the extension. Flip it off andphoto_001.pngbecomesphoto_001. - path_include_filename (default true) - whether
pathincludes the filename itself or just the folder. With it on,pathis the full file path; off, you get the directory.
Outputs are image (the IMAGE tensor), mask (the inverted alpha, same convention as core ComfyUI), file_name, and path. If you've used the core node, everything here behaves the way you expect - this one just surfaces the metadata that ComfyUI normally swallows.
Where you'd actually use it
Pair it with the pack's filename tooling or a save node that can accept a name input, and your output filenames stop being ComfyUI_00001_ and start being the source image's name. It also composes with the logic layer: file_name feeds a List Create (NH)/List Filter (NH) pipeline or a switch, so you can branch behavior on which image came in. The README's suggested workflow is exactly this - load with metadata, use file_name/path for naming outputs or routing.
Installing
ComfyUI Manager → search NH-Nodes → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/jetthuangai/NH-Nodes.git
cd NH-Nodes
pip install -r requirements.txt
Restart and refresh the browser tab. Pillow/numpy only - no heavy deps for this node.
Gotchas
The mask is inverted-alpha, like core ComfyUI, so if you're used to "white = opaque" from some other tool, double-check before wiring it into a mask pipeline. And the string outputs are relative to ComfyUI's input folder as ComfyUI resolves it, not necessarily an absolute OS path - that catches people who paste the path straight into a script. Minor: there's no repeat/batch-loading here; if you need a folder of images, that's Load Images Folder (NH).
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png | |
| filename_extension | BOOLEAN | true | — |
| path_include_filename | BOOLEAN | true | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| file_name | STRING | — |
| path | STRING | — |