LLM Config
The API key hub that feeds every LLM node in this pack
- llm_config
LLM Config is the pack's "point it at an API and stop asking" node. Every LLM-powered node in this pack (the prompt enhancer being the main one) needs an llm_config before it'll do anything, and this is where that config comes from. Pick a provider, name a model, handle the API key - it packages all of that into a single LLM_CONFIG value you wire anywhere. Nothing runs locally, which is worth stating plainly: this is a key-management and routing node for cloud LLM APIs, not a model runner.
How it works
It's pure configuration logic, no network calls at all. Pick a provider and it fills in the known endpoint - OpenAI's api.openai.com/v1, xAI's for Grok, Google's for Gemini. The model string is whatever you want to use with that provider (defaults like gpt-4o and grok-2 are suggested). The api_key handling is the clever part and supports three ways in:
- Leave it empty - falls back to the provider's standard environment variable (
OPENAI_API_KEY,XAI_API_KEY,GOOGLE_API_KEY) $ENV.VAR_NAME- reference any environment variable- Type the key directly - works, but the code comments warn it can leak into workflow metadata, which lives in your saved PNGs
For a Custom provider, custom_endpoint lets you point at any OpenAI-compatible server - that's your ticket to local LLM backends like Ollama or vLLM, or any hosted clone. max_tokens caps the response (0 lets the API decide; some models require an explicit value).
The inputs
provider- OpenAI, Grok, Google, or Custommodel- the model name stringapi_key- direct key,$ENV.VAR_NAME, or empty for the default env varcustom_endpoint(optional) - only used for Custommax_tokens(optional) - response cap, default 0 (API decides)
Output: llm_config, wired into any node that takes LLM_CONFIG input.
Install
Pack install via ComfyUI Manager (search "Latent Astronaut Suite") or:
cd ComfyUI/custom_nodes
git clone https://github.com/latentastronaut/comfyui-latent-astronaut-suite
Restart. On first boot install.py installs the openai and google-genai clients the LLM nodes need.
Where people get burned
Forgetting the key entirely is the classic failure - a blank key with no env var set gives you an auth error at generation time, not at config time. The $ENV syntax is the safer habit; hardcoding a key into the node is convenient but the pack's own docs warn it leaks into saved workflow metadata. And note the config node doesn't validate anything - typos in the model name or endpoint fail later, when the enhancer actually calls out.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| provider | COMBO | OpenAI | LLM provider to use |
| model | STRING | gpt-4o | Model name (e.g., gpt-4o, grok-2, gemini-1.5-flash) |
| api_key | STRING | API key, $ENV.VAR_NAME, or leave empty for default env var | |
| custom_endpointopt | STRING | Custom OpenAI-compatible endpoint URL (for Custom provider) | |
| max_tokensopt | INT | 00–128000 | Max tokens in response (0 = let API decide, required for some models) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| llm_config | LLM_CONFIG | — |