Nodes/4A NovelAI/NAI Sampler
ComfyUI Node

NAI Sampler

The one node in this pack that actually phones NovelAI

By tsukino4a·Created 20 days ago·Updated 7 days ago· 5
NAI Sampler
  • model
  • references
  • image_source
  • image
  • result
positive
negative
characters
streamingtrue
steps28
cfg5.0
samplerk_euler_ancestral
schedulerkarras
cfg_rescale0.00
width832
height1216
seed0
save_webpfalse

Every other node in this pack gets you ready; NAI Sampler is the one that fires. It packages your prompt, characters, settings, and optional references or source image, sends the request to NovelAI's servers, and drops the result back into your graph as if a local KSampler had made it. It's a text-to-image, image-to-image, and inpainting node all in one - the mode comes from whatever NAI Image Input handed it, not from a separate node.

The important framing, straight from the KB's external-api-nodes essay: this is an API call, not local inference. There's no checkpoint loading, no VRAM, and each run is a paid generation against your NovelAI account that consumes Anlas. Your prompt and images leave your machine. That's the deal with this entire pack, and the Sampler is where the deal is actually executed.

The inputs that matter

  • model, positive, negative, characters - the outputs of NAI Model Loader and NAI Prompt Scheduler. All are forceInput strings/typed sockets; the Scheduler's characters JSON is parsed back into per-character generation here.
  • steps (default 28, 1–50), cfg (default 5, 0–10), cfg_rescale (default 0, 0–1) - the familiar knobs, in NovelAI's own vocabulary.
  • sampler - seven choices: k_euler_ancestral (default), k_euler, k_dpmpp_2m, k_dpmpp_2m_sde, k_dpmpp_2s_ancestral, k_dpmpp_sde, k_dpm_2. The k_dpmpp_2m_sde entry is the newest addition - the official DPM++ 2M SDE sampler, added in pack version 1.0.2.
  • scheduler - karras (default), exponential, polyexponential.
  • width, height, seed - the image seed lives here, not on the Scheduler (the Scheduler's seed is only for wildcard selection - easy to mix up).
  • streaming (default on) - uses NovelAI's streaming endpoint so you get live progress previews instead of staring at a spinning node.
  • Optional references and image_source - from NAI Reference Resources and NAI Image Input, for reference-guided and img2img/inpaint runs.

Outputs

Two of them: image, a normal ComfyUI IMAGE tensor you can preview or post-process like any other, and result, the NAI_RESULT carrying the original PNG bytes - feed that to NAI Original Image Saver to save the untouched file. The Sampler is an output node, so it always runs and the graph executes backward from it.

The retry policy, and why it exists

The README spells out a rule worth reading before you batch: transient failures are retried only for single-image text generation within the Normal pixel budget at ≤28 steps with no paid reference features. Large/Wallpaper sizes, img2img, inpainting, more than four Vibes, Precise Reference, and Vibe encoding are all sent exactly once. That's not stinginess - those are the expensive calls, and auto-retrying a paid request that may have succeeded server-side is how you burn Anlas. If a big batch fails, it's on you to decide whether to resend.

Install and gotchas

Pack install as always - ComfyUI Manager (search 4A NovelAI) or clone + python install.py, restart. You'll need your Persistent API Token set (via NAI Usage Monitor or Settings → 4A NovelAI → Account), and an account with Anlas to spend. And one V5 reminder from the source: if your selected model is V5, connected references are dropped before the request is built - the sampler follows the model's rules.

Category4A NovelAI

Inputs (16)

NameTypeDefaultDescription
modelNAI_MODEL
positiveSTRING
negativeSTRING
charactersSTRING
streamingBOOLEANtrue
stepsINT281–50
cfgFLOAT5.00–10
samplerCOMBOk_euler_ancestral7 options: k_euler_ancestral, k_euler, k_dpmpp_2m, k_dpmpp_2m_sde, k_dpmpp_2s_ancestral, k_dpmpp_sde, +1
schedulerCOMBOkarras3 options: karras, exponential, polyexponential
cfg_rescaleFLOAT0.000–1
widthINT83264–2048
heightINT121664–2048
seedINT00–4294967295
save_webpBOOLEANfalse
referencesoptNAI_REFERENCES
image_sourceoptNAI_IMAGE_SOURCE

Outputs (2)

NameTypeDescription
imageIMAGE
resultNAI_RESULT