Nodes/ComfyUI-NS-Util/Simple LLM Agent
ComfyUI Node

Simple LLM Agent

Turn an LLM config and a system prompt into something you can call

By NakamuraShippo·Created about a year ago·Updated 4 months ago· 5
Simple LLM Agent
  • config
  • AGENT
system_promptYou are a helpful AI assistant.

Most ComfyUI LLM node packs make you wire the model choice, the API key, and the system prompt all over the place. Simple LLM Agent takes the opposite route: it's a bundling step. You feed it an LLM_CONFIG (from one of the pack's Simple LLM Config nodes) plus a system_prompt, and it packages them into a single AGENT object you can pass around your graph. One wire instead of four.

Calling something an "agent" is doing a lot of work there, and it's worth being blunt: there's no tool use, no memory loop, no planning. It's a config + system prompt + (empty) history dict, bundled so the rest of the graph can treat "the LLM" as one thing. Which is fine - the Simple LLM suite is a deliberately minimal take on getting text out of an LLM inside ComfyUI, and this is the assembly step that makes the rest of it tidy.

How it works

Mechanically it's about as simple as a node gets. It takes the config dict you built and the system_prompt string, and returns a single AGENT value. That value carries the provider choice, model name, temperature, max tokens, API key, and the system prompt all together. When you later feed that AGENT into Simple LLM Run: Prompt, it knows which driver to use (OpenAI, Claude, Gemini, or Ollama) and how to behave - no need to re-specify anything.

The config comes from the pack's four config nodes:

  • Simple LLM Config: OpenAI / Claude / Gemini - each lets you pick a model, set temperature and max_tokens, and optionally paste an api_key.
  • Simple LLM Config: Ollama - the local option. It takes a model name (default llama3) and a base_url (default http://localhost:11434), and needs no key at all.

That last one is the sleeper feature of this whole suite: run Ollama locally and the entire chain works offline with no API key, no account, no per-token bill.

Inputs and output

  • config (LLM_CONFIG) - the output of a Simple LLM Config node.
  • system_prompt (multiline STRING, default "You are a helpful AI assistant.") - this is where you set the persona or the rules that apply to every prompt you run through the agent.

Output is a single AGENT, which you wire into Simple LLM Run: Prompt (or, if you're building the RAG variant, into a query pipeline that then hands text to Run Prompt).

The honest caveats

The pack's own README labels the whole LLM section "Implementing the tests now" - it's beta-tier, and it shows in the small things. The API calls use plain requests with 30-second timeouts and no retry logic, and errors come back as strings that begin with "Error:" rather than as proper failures. If your key is wrong you'll get that string on the output, which is at least debuggable.

Also: don't confuse this with agentic frameworks. There's no loop here. It's a labeled bundle. If you came looking for multi-step agents that call tools, this isn't that - this is "the LLM, as a data type."

Installing it

It's part of ComfyUI-NS-Util:

cd ComfyUI/custom_nodes
git clone https://github.com/NakamuraShippo/ComfyUI-NS-Util

or via ComfyUI Manager → Install via Git URL with the same URL, then restart. No models download; dependencies are the pack's light set. For the API providers you'll want OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY set as environment variables (or pasted into the config node). For Ollama, just have Ollama running.

When you'd reach for it

If you want to inject an LLM into a workflow - generating a prompt from a brief, summarizing tags, rewriting captions - this is the cleanest way in the pack to set it up. One config node, one agent node, one run node, done. Just don't expect the "agent" to do anything but what its system prompt tells it.

CategoryNS/LLM/Agent

Inputs (2)

NameTypeDefaultDescription
configLLM_CONFIG
system_promptSTRINGYou are a helpful AI assistant.

Outputs (1)

NameTypeDescription
AGENTAGENT