Ollama Header — Custom
Add any HTTP header you want to your model server requests
- headers
- headers
Bearer tokens and basic auth cover the common cases, but some servers want something else entirely - an API key under a custom header name, a tenant ID, a specific user agent, a X-API-Key that the front proxy insists on. Ollama Header - Custom is the generic valve: type any header name and value, and it gets added to every request your LLM nodes make.
How it works
Same architecture as the other header nodes: it merges a name: value pair into the OLLAMA_HEADERS dictionary that you chain into Ollama Client. The node requires both name and value as strings, and it won't let you add a header with an empty name - you get a clear "header name cannot be empty" error rather than a silently broken request. Output is the merged headers bundle.
Where the dedicated nodes are opinionated (Bearer Token always writes Authorization: Bearer …, Basic Auth always writes Authorization: Basic …), this one is a pure passthrough: whatever you type as name becomes the header key verbatim. That's its strength and its footgun.
The footgun
It's easy to type a header that doesn't match what the server expects. Header names are case-insensitive on the wire, so x-api-key and X-API-Key are the same header - but the value must match exactly, including any prefix the server wants ("Key abc…" vs. "abc…"). And a header the server doesn't recognize is usually ignored silently. So if auth isn't working, check against the server's docs, don't just keep retyping variations.
One more: Authorization is a special header, and this node can write it. If you chain Ollama Header - Custom with name: Authorization alongside a Bearer Token or Basic Auth node, whichever runs later in the chain wins and silently overwrites the other. Use the dedicated nodes for auth and reserve Custom for everything else - that division of labor will save you a confusing debugging session.
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. Lives under dv/ollama/headers. Like all header nodes, it only matters when you're talking to a server that wants headers - a plain localhost Ollama ignores them.
Gotchas
- Chain it, don't fan it out.
headersin →headersout; stack several custom headers by feeding one into the next. - Secrets again. Custom headers frequently carry API keys. Same rule as the other auth nodes: whatever's in the widget ends up in the .json, so don't ship real credentials in a shared workflow.
- Empty name is rejected, empty value is fine - a header with an empty value is legal and sometimes exactly what a server wants as a toggle, so don't assume an empty value is a bug.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| name | STRING | — | |
| value | STRING | — | |
| headersopt | OLLAMA_HEADERS | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| headers | OLLAMA_HEADERS | — |