A ComfyUI extension for generating images via the NovelAI API.
git clone https://github.com/bedovyy/ComfyUI_NAIDGeneratorinto thecustom_nodesdirectory.- or 'Install via Git URL' from Comfyui Manager
Before using the nodes, you should set NAI_ACCESS_TOKEN in a .env file located in your main ComfyUI directory.
ComfyUI/.env
NAI_ACCESS_TOKEN=<YOUR_ACCESS_TOKEN>
You can get a persistent API token by navigating to User Settings > Account > Get Persistent API Token on the NovelAI website.
Otherwise, you can get an access token which is valid for 30 days using novelai-api.
The nodes are located in the NovelAI category.
Simply connect the GenerateNAID node to a SaveImage node.
Note: All generated images via the GenerateNAID node are automatically saved to output/NAI_autosave/NAI_autosave_#####_.png to preserve their original metadata.
Connect an Img2ImgOptionNAID node to the option input of the GenerateNAID node and provide a source image.
Note: The width and height of the source image will be resized to the generation size.
Connect an InpaintingOptionNAID node to the GenerateNAID node and provide a source image and a mask.
Note: Both the source image and mask will be automatically resized to fit the generation size.
Connect a VibeTransferOptionNAID node to the GenerateNAID node and provide a reference image to transfer its style and feel.
You can also chain it with other options, like Img2Img.
Connect multiple VibeTransferOptionNAID nodes to combine their influences.
Use the CharacterReferenceOptionNAID node to guide the generation using a single reference image for character identity and/or style.
- style_aware: If enabled, it attempts to copy both the character's features and the artistic style.
-
fidelity: Controls how strictly the generation should adhere to the reference image. The developers state that
primary_strengthis always kept at1.0, whilesecondary_strengthis calculated as$1.0 - \text{fidelity}$ .
Note: The reference image will be automatically letterboxed to an accepted NAI canvas size to preserve its aspect ratio.
The default model of the GenerateNAID node is nai-diffusion-4-5-full. To change the model, connect a ModelOptionNAID node.
Available V4+ models include:
nai-diffusion-4-curated-previewnai-diffusion-4-fullnai-diffusion-4-5-curatednai-diffusion-4-5-full
You can set timeout and retry options using the NetworkOption node. You can also set ignore_errors to prevent the queue from stopping on an API error; if an error occurs, a blank 1x1 image will be output.
Note: If you set the timeout too short, you may not receive an image but could still be charged Anlas.
This extension now includes Anlas tracking to monitor your usage.
1. Console Output (Automatic) All generation and director tool nodes will automatically print your Anlas balance before and after the operation in the console where you launched ComfyUI.
[NovelAI] Anlas (pre-gen): 10000
[NovelAI] Generation cost: 20 Anlas
[NovelAI] Anlas (post-gen): 9980
2. Visual Node
A new node, Anlas Tracker βοΈπ
π
π
, is available in the NovelAI/utils category. You can use it to display your current Anlas balance directly in your workflow.
Connect its anlas_string output to a display node (e.g., "Show Text" from the WAS Node Suite) to see the value. Use the trigger input to control when the balance is checked.
ComfyUI uses () or (word:weight) for emphasis, while NovelAI uses {} and []. This node, found in NovelAI/utils, converts ComfyUI's prompt syntax to NovelAI's.
You can find director tools like LineArtNAID, EmotionNAID, and RemoveBGNAID in the NovelAI/director_tools category.
The nodes fully support NAI's V4 and V4.5 model architecture.
Two new nodes have been added in NovelAI/v4 for V4/V4.5 prompt handling:
V4BasePrompt: Handles the positive prompt.V4NegativePrompt: Handles the negative prompt.
Here's a basic setup for a V4/V4.5 model:
V4BasePrompt -----> positive
GenerateNAID
V4NegativePrompt -> negative
Note: Basic img2img, vibe transfer and inpainting functionality works with V4/V4.5.













