NovelAIRequest
NovelAIRequest
- payload
- image
This is the node that makes the phone call. NovelAI_Request (shown as NovelAIRequest) is the executor of the NovelAI half of the DiaoDaiaChan/ComfyUI_API_Request pack: you hand it a payload built by NovelAI_Request_Payload, it calls NovelAI's hosted image API, and it returns a normal ComfyUI IMAGE you can preview, save, or pipe into whatever else. No checkpoints, no VRAM, no local diffusion - the generation happens on NovelAI's servers and you pay for it in Anlas, their credit currency.
It's the right tool for a specific situation: you like your ComfyUI graph, but you want NovelAI's models (nai-diffusion-3, the v4 line) without running them locally - or you're on a machine where they won't run at all. The tradeoff is that this is a paid API, not free local inference, and the node's job is only to ferry bytes. If that's the setup you want, this is the entire package in one node.
How it works
The mechanism is simple and worth knowing because it explains the failure modes. NovelAI_Request takes your token (more on that below), builds browser-like headers, and POSTs the payload to https://image.novelai.net/ai/generate-image. NovelAI doesn't return a plain image - it returns a zip archive of PNGs, so the node unzips the response into ./temp/api_request in your ComfyUI folder, reads the PNGs back, and stacks them into an IMAGE tensor. If the API answers 429 (rate limited), the code sleeps five seconds and retries the request for you, which is thoughtful of it.
The inputs that matter
- payload (required): the
NovelAITXT2IMGPayloadoutput fromNovelAI_Request_Payload. Nothing else feeds this node. - token: your NovelAI auth token. Leave it blank and the node falls back to the
NOVELAI_TOKENvariable in a.envfile in your ComfyUI root folder. Using the.envroute is strongly better - a token sitting in a node's text box gets embedded in every saved workflow PNG. - proxy: defaults to
http://127.0.0.1:7890. That's the standard Clash proxy port, and it's the single most common "why does nothing happen" cause: if you aren't running Clash or similar, clear this field or every request dies at the connection stage.
Its only output, image, is an IMAGE tensor - wire it into a PreviewImage or SaveImage like you would any other sampler output.
Getting your token
You can't just type in a NovelAI password. The README's trick is to open the novelai.net site in a browser, open the console, and run:
console.log(JSON.parse(localStorage.session).auth_token);
That string is effectively your account's API credential - treat it like a password, don't paste it into shared workflows, and prefer the .env route:
NOVELAI_TOKEN=ey....
Install and gotchas
Install once for the whole pack, via ComfyUI Manager (search "ComfyUI_API_Request" or "SDAPI Request / NovelAI") or:
cd ComfyUI/custom_nodes
git clone https://github.com/DiaoDaiaChan/ComfyUI_API_Request
Restart ComfyUI. The only real dependency is python-dotenv (for reading that .env); nothing heavy, no model files to download - which is the point of the pack. Note that NOVELAI_TOKEN must live in the ComfyUI root directory's .env, not inside the custom node folder.
Other things that bite people: rate limits are real, and the built-in 429 retry can make a batch hang for minutes if you're hammering the API - pace your n_iter accordingly. And because this is a hosted service, your images go over the network to NovelAI; if that matters to you, this node isn't the answer.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| payload | NovelAITXT2IMGPayload | — | |
| tokenopt | STRING | ey.... | — |
| proxyopt | STRING | http://127.0.0.1:7890 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |