NAI Load Image
Read what that NovelAI PNG actually says before you re-guess it
- image
- mask
- nai_context
- character_pipe
ComfyUI's stock Load Image node is deliberately dumb: pick a file, hand out pixels. Fine for a photo you shot, useless for NovelAI output - the interesting part of an NAI render isn't the pixels, it's the prompt, every character's text and position, and the sampler settings packed into the file.
NAI Load Image is Load Image plus the part that reads all of that. No token, no Anlas, no network call.
Why it's worth a node slot
Anyone who's dragged an image from the NAI gallery into an img2img node and retyped the prompt from memory knows the gap between guessing and seeing. NAI writes a rich sidecar into its outputs: base prompt, negative, per-character captions and coordinates, seed, steps, sampler, CFG, model.
The second reason is more interesting than re-use. NAI's multi-character system is regional conditioning done server-side - each slot gets its own prompt and an X/Y center - and it fails the same way ComfyUI's regional prompting does: two subjects in one prompt reliably swap hair colours and clothing. Reading a real character split, coordinates included, teaches you more than any tutorial.
How it works
The only socket input is image - the same dropdown-and-upload widget as stock Load Image. Everything else is a panel the pack's JavaScript draws inside the node.
Opening it hits a small route the pack registers on the ComfyUI server, which returns a parsed summary. Parsing is Python and entirely local: PNG text chunks, then WebP EXIF (UserComment and the description/artist tags), then the alpha-channel variant - the stealth_pngcomp string in the source. That one is gzipped JSON packed into the least-significant bits of the alpha plane, column-major, with a big-endian bit length in the header. Reading it is why this isn't a PIL one-liner.
Then it normalises. NovelAI names things its own way - scale is CFG, noise_schedule is the scheduler - and those get mapped onto fields a generation node actually has. Models come from an ID hash table; characters come out of v4_prompt's char_captions with their centers.
The other half is Apply settings: it fills the widgets of whichever generation, img2img or inpaint node you point it at, and wires up a Character Prompt Select node if there isn't a spare one. Nothing is queued, nothing goes to NovelAI, and the target's limit_opus_free stays as you set it.
Outputs and the panel
Outputs are the familiar pair - image (IMAGE) for anything downstream, mask (MASK) from whatever alpha the file had. Watch that second one: on a PNG whose alpha plane has been turned into a metadata bit stream, the mask is noise near zero, not a selection. If the filename sits outside ComfyUI's input, output or temp folder the node refuses outright rather than loading something odd.
The panel shows prompt and negative with Copy buttons, an expandable Characters section, Generation settings, and Detailing history for composites. Apply to… plus Refresh targets picks the destination; applying reports what it applied and what it skipped.
Installing it
Manager → Custom Nodes Manager → search ComfyUI_RS_NAI_API_Request → Install. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/raspie10032/ComfyUI_RS_NAI_API_Request.git
cd ComfyUI_RS_NAI_API_Request
python -m pip install -r requirements.txt
That requirements file is light - requests, Pillow, numpy, python-dotenv, plus torch and segment-anything, which the pack's detailer nodes need far more than this one does. Restart ComfyUI afterwards and hard-refresh the tab: the panel is JavaScript served from the pack's web folder, so a stale page won't have it.
The generators read NAI_ACCESS_TOKEN from a .env in the node directory; this node doesn't need one. It's new in pack version 2.7.0, so update first if it isn't in your list.
Where people get burned
"No NAI generation information found." The file got laundered. Image hosts, editors, screenshots and social re-encoding all strip metadata, and no loader recovers what isn't there. Keep the original download - a small file, or a .webp extension, proves nothing either way.
Characters don't apply. NAI sometimes places characters automatically instead of with coordinates, coordinates can be finer than the 0.1 grid this pack's character node takes, and V4/V4.5 cap at 6 slots where V5 allows 22. Any of those, or a Character Prompt Select shared elsewhere, and the loader skips it rather than rounding. The text is still there to copy.
The model won't resolve. Older NAI files identify it by hash, and unrecognised hashes get reported rather than guessed.
You drag one of the pack's autosaved PNGs back in to recover your graph and get nothing. Correct: autosaves keep NAI information instead of embedding a ComfyUI workflow. Hang a standard Save Image node off the output if you want both.
And the honest caveat - this reads metadata, it doesn't verify it. There's no NovelAI signature check, so treat an unfamiliar file's contents as claims, not facts.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png | |
| context_modelopt | COMBO | from_metadata | Use the recorded model, or explicitly choose the original model when only an unknown hash was saved. Other missing/unsupported settings are reported, never guessed. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| nai_context | NAI_CONTEXT | — |
| character_pipe | RS_MC_CHARACTER_PIPE | — |