Nodes/ComfyUI_RS_NAI_API_Request/NAI Reference Inset Generate
ComfyUI Node

NAI Reference Inset Generate

It will block you on purpose

By raspie10032·Created 2 years ago·Updated about 15 hours ago· 10
NAI Reference Inset Generate
  • inset
  • characterPrompts
  • image
  • full_canvas
  • applied_prompt
◄prompt►
◄negative_promptlowres, bad anatomy►
◄modelNAI Diffusion V5 Full►
◄seed-1►
◄steps28►
◄cfg_scale6.0►
◄limit_opus_freetrue►
◄samplerk_euler_ancestral►
◄schedulerkarras►
◄save_formatPNG►
◄webp_quality90►
◄request_delay_seconds0.0►

You wire it up, hit Queue, and it fails. Every time. That's not a broken install - that's the default doing exactly what the author intended.

This node spends Anlas. Reference inset generation is ordinary inpainting on NovelAI's side, and a base image can cost credits even at Opus-free dimensions, so the pack ships limit_opus_free = True as the default and refuses before it reads your token, before it uploads anything. The error says so and points you at the free preparation node. Once you've decided the layout is worth the money, you flip it to False and it runs.

What it does with the canvas

The inset input carries the prepared canvas, mask, and crop box from NAI Reference Inset. This node then:

  1. Appends the tag reference inset to your prompt if it isn't already there - including weighted forms like {reference inset} or 1.2::reference inset::, which it leaves alone rather than doubling up.
  2. Sends the canvas and mask to NovelAI as inpainting at full strength (inpaintImg2ImgStrength = 1.0, noise = 0). There is no denoise dial on this node. The knob that controls how much the reference matters lives on the prep node, as reference_percent.
  3. Composites the response back through the mask, so the reference-side pixels are your prepared ones verbatim - even if the server returned something different there.
  4. Crops the generated area exactly and returns it.
  5. Autosaves both files under the usual dated NAI_autosave folder, named NAI_inset…, with the full canvas getting a _canvas suffix and both keeping NovelAI's metadata plus an rs_nai_inset record of the canvas size and crop box.

If the API hands back a canvas of the wrong size, it raises an error rather than quietly resizing or cropping - which is the right call, since a silent resize would wreck the composite.

Inputs worth setting

  • prompt - describe the reference character and the new scene. The tag gets added for you, so don't type it.
  • negative_prompt - defaults to lowres, bad anatomy. Keep it short; NovelAI's anime models are Danbooru-trained and don't want a forty-tag negative wall.
  • model - defaults to NAI Diffusion V5 Full. V5 Full - Medium Effort works but uses its fixed 14 steps, Euler Ancestral, zero CFG Rescale and the Heavy Undesired Content preset - your steps, negative_prompt and sampler are ignored while it's selected, and the node shows a notice saying so. V5 Curated inpainting falls back to V4.5 Curated internally, as the official client does.
  • steps (28), cfg_scale (6), seed (-1 = random), optional sampler (k_euler_ancestral) and scheduler (karras).
  • limit_opus_free - True blocks; False permits possible spending. The tooltip is blunt about it.
  • characterPrompts - optional, from NAI Character Prompt Select. Their 0–1 coordinates describe the cropped output, and the node maps them onto the canvas for you. That's a genuinely nice touch; hand-mapping coordinates into a padded canvas is exactly the sort of thing people get wrong. Positions still bleed between characters if you describe several in one slot set (regional-prompting.json), so keep using the slots properly.

Outputs

  • image - the new area only, cropped to size. This is the one you preview and save.
  • full_canvas - reference plus result, in one frame. Handy when you want the "before and after" layout as a single picture.
  • applied_prompt - the exact string that went out, tag included. Wire it to a text display node when you're debugging a prompt you've been editing via Character Asset Load.

Install and run

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

ComfyUI Manager: search ComfyUI_RS_NAI_API_Request, Install, restart. Then put NAI_ACCESS_TOKEN=your_token_here in a .env inside the pack folder. The pack's requests share one lock with at least two seconds between network attempts, so graphs with several generative nodes feel paced rather than fast. A "not found in environment variables" error almost always means the .env is in the wrong folder.

Load Image → NAI Reference Inset → NAI Reference Inset Generate → Preview Image

Honest expectations

The author's release notes are unusually straight about this: two live requests on 2026-10-11 (V5 Full and Medium Effort, 1024×768 canvas, 50% left reference, both returning a 512×768 crop). Reference-side pixels were preserved exactly, and the blue robot's body, display face and red flower carried into the new park-bench scene. They call it a smoke test, not a consistency benchmark.

Believe them. Reference strength depends on the model, the source image, your prompt, and how much canvas the reference got. Simple backgrounds beat busy ones, style carries over more than you might want, and repeated panels happen. Expect "useful guidance," not "same character, guaranteed" - for nailing a character, the pack's character prompts and its Detailer are the tools built for it.

CategoryRS_NovelAI_API/Reference Inset

Inputs (14)

NameTypeDefaultDescription
insetRS_NAI_INSET—
promptSTRINGDescribe the reference character and the new scene. reference inset is added automatically if absent.
negative_promptSTRINGlowres, bad anatomy—
modelCOMBONAI Diffusion V5 FullV5 Full Medium Effort always uses 14 steps, Euler Ancestral, zero CFG Rescale, and fixed Heavy Undesired Content. Custom base/character negative prompts are ignored. Prompt Guidance remains adjustable. Image-to-image and inpainting require limit_opus_free=False and can spend Anlas. V5 Curated inpainting uses V4.5 Curated.
seedINT-1-1–4294967295—
stepsINT281–50—
cfg_scaleFLOAT6.00–30—
limit_opus_freeBOOLEANtrueReference inset uses ordinary inpainting. True blocks before token access or encoding. False permits possible Anlas spending.
sampleroptCOMBOk_euler_ancestral7 options: k_dpmpp_2m, k_dpmpp_sde, k_dpmpp_2m_sde, k_dpmpp_2s_ancestral, k_euler_ancestral, k_euler, +1
scheduleroptCOMBOkarras4 options: native, karras, exponential, polyexponential
characterPromptsoptLIST,RS_MC_CHARACTER_PIPE,NAI_CONTEXTOriginal character prompts. Coordinates 0–1 refer to the generated output and are mapped to the full canvas automatically.
save_formatoptCOMBOPNGAutosave format. Preserves NovelAI generation information. No ComfyUI workflow is embedded.
webp_qualityoptINT901–100Used only for lossy WebP. Lossless WebP preserves pixels.
request_delay_secondsoptFLOAT0.00–3600Wait before each NovelAI request, including each detail region and uncached Vibe encoding. 0 adds no delay. The built-in 2-second gap overlaps this timer; a longer server retry wait still applies. Preview-only runs do not wait. Stop cancels the countdown.

Outputs (3)

NameTypeDescription
imageIMAGE—
full_canvasIMAGE—
applied_promptSTRING—