Nodes/ComfyUI-Multi-Prompt-Generator/NAI Multi Prompt Generator
ComfyUI Node

NAI Multi Prompt Generator

Generating from inside ComfyUI with the NAI Multi Prompt Generator

By mrm987·Created 8 months ago·Updated 8 months ago· 0
NAI Multi Prompt Generator
  • reference_image
  • images
base_prompt1girl, solo, best quality, amazing quality, very aesthetic, absurdres,
negative_promptlowres, bad quality,
prompt_list# Blank line = new prompt # 빈 줄 = 새 프롬프트 smile, happy angry, furrowed brow sad, crying
width832
height1216
seed0
random_seed_per_imagefalse
steps28
cfg5.0
sampler
scheduler
smea
nai_model
save_prefixNAI_MultiPrompt
skip_indices
varietyfalse
decrisperfalse
free_onlytrue
cfg_rescale0.00
uncond_scale1.00
uc_presetHeavy
quality_tagstrue
char_ref_style_awaretrue
char_ref_fidelity1.00
lut_name
lut_strength0.30
enable_previewtrue

The name is the whole pitch: it's the Multi Prompt Generator's sibling, but instead of sampling locally it fires your prompt list at NovelAI's image API and saves the results. Same pack, genuinely different thing - there are no model, CLIP, or VAE inputs at all. You give it prompts, NovelAI's servers do the work, and your GPU mostly sits this one out.

Which means it needs an account and a token. NovelAI is a paid subscription, and nothing about the node's default settings is trying to hide that - it ships tuned for the Opus plan's free tier.

Setup

The token lives in a .env file in your ComfyUI root folder:

cd /path/to/ComfyUI
echo "NAI_ACCESS_TOKEN=your_token_here" > .env

The node also checks the NAI_ACCESS_TOKEN environment variable as a fallback, and raises a clear error if it's missing. It calls the standard image.novelai.net generate endpoint using the same parameter vocabulary the NovelAI web UI speaks.

How it works

Same prompt_list format as its sibling - blank-line blocks, # comments, - to skip - and each block becomes one API call. The interesting part is how much of NovelAI's own setting surface it exposes: the model (nai-diffusion-4-5-full, the V4.5 curated preview, or nai-diffusion-3), sampler and scheduler, SMEA / SMEA+DYN for higher resolutions, variety, decrisper, the uc_preset undesired-content presets (Heavy / Light / Human Focus / None), and quality_tags, which appends NovelAI's standard quality tags the way the web UI does.

Three details worth knowing before you spend a batch of credits:

  • free_only defaults to True. The Opus free tier caps you at 1MP output and 28 steps, and when it's on the node silently clamps width/height to ≤1,048,576 pixels and steps to 28. The README's resolution guide: 832×1216 portrait, 1216×832 landscape, 1024×1024 square.
  • Multi-character prompting is built in. Use | to split a base prompt from up to six character captions - 2girls, scene, background | 1girl, blonde, smile | 1girl, black hair, angry - and the negative prompt accepts the same separator for per-character negatives. That's NovelAI V4.5's character-prompts feature surfaced directly.
  • Auto-retry is real. Calls retry up to three times with backoff on 429, 500, 502, 503 and 504, so transient server hiccups usually resolve themselves.

Character reference works too: feed an IMAGE into reference_image, and char_ref_style_aware decides whether it copies style along with identity while char_ref_fidelity sets how strictly it matches. Results preview as they land, get the same optional LUT treatment, and save to output/NAI_MultiPrompt/ with the seed and full prompt embedded in the PNG metadata.

The inputs that matter

  • nai_model - reach for V4.5 unless you have a specific reason not to.
  • width / height - keep under 1MP if free_only is on (it clamps anyway, but better to pick the framing yourself).
  • sampler + scheduler - k_euler + native is the stable recommendation; k_euler_ancestral + native for more variety.
  • cfg - 4–6 is the V4.5 sweet spot; it works well lower than you'd expect.

Install

Identical to its sibling - ComfyUI Manager (search "Multi Prompt Generator") or git clone, then restart:

cd ComfyUI/custom_nodes
git clone https://github.com/mrm987/ComfyUI_Multi_Prompt_Generator.git

Dependencies are just requests and python-dotenv. No local model downloads for this node at all - your only cost is API credits.

Common issues

The usual suspects: 401/403 means a bad or expired token, and 429 means you've hit rate limits - the retry logic handles the transient ones, but a plan or billing limit won't go away. If your resolution keeps getting clamped in ways you didn't ask for, that's free_only doing exactly what it says. One more thing: the README advertises a local upscale pass for this node, but that isn't in the shipped code - the NAI node is API call, optional LUT, save. Plan any upscaling in a separate workflow.

Categoryimage/generation

Inputs (28)

NameTypeDefaultDescription
base_promptSTRING1girl, solo, best quality, amazing quality, very aesthetic, absurdres,
negative_promptSTRINGlowres, bad quality,
prompt_listSTRING# Blank line = new prompt # 빈 줄 = 새 프롬프트 smile, happy angry, furrowed brow sad, crying
widthINT83264–2048
heightINT121664–2048
seedINT00–18446744073709550000
random_seed_per_imageBOOLEANfalseUse different random seed for each image
stepsINT281–50
cfgFLOAT5.00–20
samplerCOMBO6 options: k_euler, k_euler_ancestral, k_dpmpp_2s_ancestral, k_dpmpp_2m, k_dpmpp_sde, ddim
schedulerCOMBO4 options: native, karras, exponential, polyexponential
smeaCOMBO3 options: none, SMEA, SMEA+DYN
nai_modelCOMBO3 options: nai-diffusion-4-5-full, nai-diffusion-4-curated-preview, nai-diffusion-3
save_prefixSTRINGNAI_MultiPrompt
skip_indicesoptSTRING
varietyoptBOOLEANfalse
decrisperoptBOOLEANfalse
free_onlyoptBOOLEANtrue
cfg_rescaleoptFLOAT0.000–1
uncond_scaleoptFLOAT1.000–1.5
uc_presetoptCOMBOHeavyUndesired Content preset (0=Heavy, 1=Light, 2=Human Focus, 3=None)
quality_tagsoptBOOLEANtrueAdd quality tags automatically (like NAI web UI)
reference_imageoptIMAGE
char_ref_style_awareoptBOOLEANtrueCopy style along with identity
char_ref_fidelityoptFLOAT1.000–1How strictly to match the character
lut_nameoptCOMBO1 options: None
lut_strengthoptFLOAT0.300–1
enable_previewoptBOOLEANtrue

Outputs (1)

NameTypeDescription
imagesIMAGE