Any LLM FunCode
The no-SDK LLM caller that lives off a .env file
- image
- text
"Any" in the name is doing real work. Any LLM FunCode is a chat-caller that talks to any OpenAI-compatible endpoint - DeepSeek, Doubao, a local vLLM/Ollama bridge, whatever - and it needs no SDK, no local model, and no key baked into the pack. It reads its config from a .env file, and the whole HTTP request is built with Python's standard library. If you've ever fought an LLM node that hard-wired one provider, that's the selling point.
This is the same pattern the wider ecosystem settled on: a language model sits in your graph as a text tool upstream of the sampler - rewriting a rough idea into a structured prompt, captioning an image, writing dialogue - not the frozen text encoder inside the checkpoint. FunCode's take on it is an API node, so there's zero VRAM budget and nothing to download. The trade-off is the one every API path has: it can't do uncensored local work, and it sends your prompts (and any image you wire in) to whoever runs the endpoint.
How it works
On the backend it's refreshingly small: the node reads ComfyUI/custom_nodes/ComfyUI_FunCode/.env, auto-reloads it when the file's mtime changes, then POSTs a standard chat-completions payload to your base URL with a Bearer key. It appends /chat/completions for you if your api_base ends in /v1, /v2 or /v3. An optional image input gets base64-encoded to a data URL and sent as an image_url message - which only works if the model you chose is a vision model.
The inputs that matter
- profile - a dropdown built from your
.env:默认配置(default config),自定义(custom), plus anyLLM_PROFILE_<id>_*entries you add. Handy for flipping between two providers without retyping keys. - api_base / api_key / model - type these in manually and they override the profile. Leave them empty to fall back to the
.envvalues. - system_prompt_select -
custom, or any.md/.txtfile you drop inComfyUI_FunCode/llm/system_prompts/(the dropdown picks them up automatically). - user_prompt - the actual ask. This one's multiline and unavoidable.
- temperature / top_p / max_tokens / timeout / seed - the usual sampling knobs, plus a 60-second default timeout you'll want to raise for slow reasoning models. Seed is passed through for the handful of APIs that honor it.
Output is a single text string. Wire it into a show-text node or straight into a prompt builder.
Installing
ComfyUI Manager → Install Custom Nodes → search "ComfyUI_FunCode", or:
cd ComfyUI/custom_nodes
git clone https://github.com/kaiery/ComfyUI_FunCode
Restart ComfyUI. Then copy .env.example to .env and fill in at least LLM_API_BASE, LLM_API_KEY and LLM_MODEL. The example ships pointing at Volcengine's Ark API (Doubao) plus a DeepSeek profile - the author's stack, not a requirement. There are no model files and the pack's only pip dependency is color-matcher, which this node doesn't touch.
Common issues
- "ERROR: api_base and model are required" - the
.envisn't where the node looks, or theapi_base/modelfields are empty with no.envfallback. Double-check the path: it's the pack root, not your ComfyUI root. - Image input does nothing - the model doesn't accept images. That's server-side, not the node.
- Editing
.envdoesn't show up - the reload-on-mtime logic handles new runs, but the profile dropdown refreshes when the node's input schema re-validates, so re-open or recreate the node. - It returns errors as normal text (
"ERROR: TimeoutError: ..."), so a failed call won't crash the graph - it'll just quietly pass a helpful-looking string downstream. Worth remembering when you're debugging.
One honest caveat: this is a small, fresh pack (Chinese README, basically zero community footprint), so treat the "any" with the usual security sniff - read what a node does before feeding it keys. Here the source is short and it's just urllib against your endpoint, which is about as boring as an LLM node gets.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| profile | COMBO | 2 options: 默认配置, 自定义 | |
| api_base | STRING | — | |
| api_key | STRING | — | |
| model | STRING | — | |
| seed | INT | 00–18446744073709550000 | — |
| system_prompt_select | COMBO | 1 options: custom | |
| system_prompt | STRING | — | |
| user_prompt | STRING | — | |
| temperature | FLOAT | 0.700–2 | — |
| top_p | FLOAT | 1.000–1 | — |
| max_tokens | INT | 20481–8192 | — |
| timeout | INT | 601–600 | — |
| imageopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |