NAI Multi Prompt Generator
Generating from inside ComfyUI with the NAI Multi Prompt Generator
- reference_image
- images
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_onlydefaults to True. The Opus free tier caps you at 1MP output and 28 steps, and when it's on the node silently clampswidth/heightto ≤1,048,576 pixels andstepsto 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_onlyis on (it clamps anyway, but better to pick the framing yourself). - sampler + scheduler -
k_euler+nativeis the stable recommendation;k_euler_ancestral+nativefor 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.
Inputs (28)
| Name | Type | Default | Description |
|---|---|---|---|
| base_prompt | STRING | 1girl, solo, best quality, amazing quality, very aesthetic, absurdres, | — |
| negative_prompt | STRING | lowres, bad quality, | — |
| prompt_list | STRING | # Blank line = new prompt # 빈 줄 = 새 프롬프트 smile, happy angry, furrowed brow sad, crying | — |
| width | INT | 83264–2048 | — |
| height | INT | 121664–2048 | — |
| seed | INT | 00–18446744073709550000 | — |
| random_seed_per_image | BOOLEAN | false | Use different random seed for each image |
| steps | INT | 281–50 | — |
| cfg | FLOAT | 5.00–20 | — |
| sampler | COMBO | 6 options: k_euler, k_euler_ancestral, k_dpmpp_2s_ancestral, k_dpmpp_2m, k_dpmpp_sde, ddim | |
| scheduler | COMBO | 4 options: native, karras, exponential, polyexponential | |
| smea | COMBO | 3 options: none, SMEA, SMEA+DYN | |
| nai_model | COMBO | 3 options: nai-diffusion-4-5-full, nai-diffusion-4-curated-preview, nai-diffusion-3 | |
| save_prefix | STRING | NAI_MultiPrompt | — |
| skip_indicesopt | STRING | — | |
| varietyopt | BOOLEAN | false | — |
| decrisperopt | BOOLEAN | false | — |
| free_onlyopt | BOOLEAN | true | — |
| cfg_rescaleopt | FLOAT | 0.000–1 | — |
| uncond_scaleopt | FLOAT | 1.000–1.5 | — |
| uc_presetopt | COMBO | Heavy | Undesired Content preset (0=Heavy, 1=Light, 2=Human Focus, 3=None) |
| quality_tagsopt | BOOLEAN | true | Add quality tags automatically (like NAI web UI) |
| reference_imageopt | IMAGE | — | |
| char_ref_style_awareopt | BOOLEAN | true | Copy style along with identity |
| char_ref_fidelityopt | FLOAT | 1.000–1 | How strictly to match the character |
| lut_nameopt | COMBO | 1 options: None | |
| lut_strengthopt | FLOAT | 0.300–1 | — |
| enable_previewopt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |