HTTP Authentication
Stop pasting the same token into every request node
- auth_config
Every API worth calling is locked behind some kind of credential. The moment your ComfyUI workflow talks to a service with a key or token, you've got two options: paste that header into every HTTP request node, or build it once here and wire it around. This node is the second option, and it's the reason the pack's method nodes have an auth input at all.
HTTP Authentication doesn't send anything by itself. It's a config builder: pick an auth_type, fill in the fields that match, and it hands you an auth_config object on its only output. That output plugs into the auth socket on any of the pack's request nodes - HTTPGet, HTTPPost, HTTPPut, HTTPPatch, HTTPDelete, HTTPHead, HTTPOptions, HTTPFileUpload, HTTPImageLoader all take it. One config, N requests, and when the token rotates you change one node instead of ten.
The dropdown and the fields that matter
auth_type is the whole show, with six choices:
- basic -
username+password, HTTP Basic auth. - bearer - the
tokenfield becomesAuthorization: Bearer <token>. This is the one most modern APIs want. - api_key -
api_keyplusapi_key_header, which defaults toX-API-Key. Set the header name to whatever the API expects. - token -
Authorization: Token <token>, Django-style. - oauth2 - here's the honest bit. This option is a stub. The code doesn't run a token exchange; it just treats the
tokenfield like a bearer token. Theclient_id,client_secret,oauth_token_url, andscopefields exist but aren't wired into the flow. If you need real OAuth2 client-credentials, use bearer with a token you fetched elsewhere, or stuff the fullAuthorizationvalue intocustom_headers. - none - useful with
custom_headersfor anything that doesn't fit the patterns above.
custom_headers takes a JSON object and merges it into every request that uses this auth. That's your escape hatch for HMAC-style headers and other weirdness.
What comes out
A single auth_config (HTTP_AUTH type). Wire it to any request node's auth input and you're done. The request node applies it to its session before sending.
Install
ComfyUI Manager → search "ComfyUI-HTTP" → Install, then restart. Or manually:
cd ComfyUI/custom_nodes/
git clone https://github.com/wawahuy/ComfyUI-HTTP.git
cd ComfyUI-HTTP
pip install -r requirements.txt
No model downloads, no heavy dependencies - everything is plain requests under the hood.
Where people get burned
custom_headers must be valid JSON or it's silently dropped with a warning in the console - you'll get a 401 and wonder why. And remember the README's advice about environment variables doesn't actually exist in the code: your keys live in the workflow JSON in plaintext. That's fine on your own machine, but a shared workflow with your API key baked in is a leak waiting to happen, so scrub credentials before posting workflows anywhere.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| auth_type | COMBO | none | 6 options: none, basic, bearer, api_key, token, oauth2 |
| usernameopt | STRING | — | |
| passwordopt | STRING | — | |
| tokenopt | STRING | — | |
| api_keyopt | STRING | — | |
| api_key_headeropt | STRING | X-API-Key | — |
| client_idopt | STRING | — | |
| client_secretopt | STRING | — | |
| oauth_token_urlopt | STRING | — | |
| scopeopt | STRING | — | |
| custom_headersopt | STRING | {} | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| auth_config | HTTP_AUTH | — |