Ollama Header — Bearer Token
Authenticate to a remote model server with a bearer token
- headers
- headers
Local Ollama on your own machine needs no auth - but the moment you point ComfyUI at a model server on your network, a VPS, or a shared box, somebody usually wants a token in front of it. Ollama Header - Bearer Token is the node that adds an Authorization: Bearer <token> header to every request your LLM nodes make, so the server will actually talk to you.
How it works
comfydv's header nodes build a dictionary of HTTP headers, chained the same way the option nodes build a dictionary of sampling parameters. This one takes a token string, wraps it in the Bearer scheme, and merges it into the OLLAMA_HEADERS bundle. Wire that bundle into your Ollama Client node and every chat, load, and unload call from your graph goes out authenticated.
Concretely, the node turns token into the header Authorization: Bearer <token> - the standard scheme used by OpenAI-compatible APIs, llama.cpp's server when you've given it an API key, and any proxy sitting in front of Ollama. If you've used an OpenAI API key anywhere, this is the same shape.
Inputs and output
- token - required STRING, the token/key itself. This is the secret - treat it accordingly.
- headers (optional) - the chain input from another header node, so you can stack Bearer Token + a custom header in one bundle.
- Output: headers - wire into Ollama Client (or chain to the next header node).
Install
Via ComfyUI Manager (search "comfydv"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/darth-veitcher/comfydv.git
Restart, and run a backend that actually requires the header - for a plain local Ollama this node is pointless, since localhost doesn't authenticate.
Gotchas
- A token in a workflow file is a token in plaintext. Shared .json workflows leak whatever's in the widget. If you're pasting real credentials, keep the workflow private - and prefer a throwaway token for anything you might share. The broader ComfyUI ecosystem has a documented history of LLM nodes being abused; don't make yours the next incident.
Authorizationis the one header that gets special treatment. If you also chain an Ollama Header - Custom node with the nameAuthorization, they collide and the later one in the chain wins. Use either Bearer Token or Basic Auth or a custom Authorization header - not two at once.- Pick the right scheme. If your server expects
Basiccredentials instead of aBearertoken, use Ollama Header - Basic Auth - the server will reject the wrong scheme with an auth error.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| token | STRING | — | |
| headersopt | OLLAMA_HEADERS | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| headers | OLLAMA_HEADERS | — |