Nodes/ComfyUI-NS-Util/Simple LLM Run: Prompt
ComfyUI Node

Simple LLM Run: Prompt

The node that actually calls the LLM (and returns text)

By NakamuraShippo·Created about a year ago·Updated 4 months ago· 5
Simple LLM Run: Prompt
  • agent
  • STRING
prompt

Every LLM node pack has one node that actually makes the phone call, and in the Simple LLM suite that's Simple LLM Run: Prompt. You hand it an agent (from Simple LLM Agent) and a prompt, it talks to whatever provider that agent is configured for, and it hands back the model's response as a plain STRING. This is where the whole thing goes from configuration to text.

The shape of it is deliberately boring, and that's the appeal. No chains, no tool loops, no vector stores in your face - just "give this agent a prompt, get text back." If you've been fighting a heavyweight agent framework to do one simple rewrite-and-feed-back-into-the-prompt task, this is the unexciting workhorse you actually wanted.

How it works

When the node runs, it reads the AGENT's config, picks the matching driver (OpenAI, Claude, Gemini, or Ollama), and calls the provider's chat endpoint with:

  • your prompt,
  • the agent's system_prompt (prepended as the system message),
  • the config's temperature and max_tokens.

The response comes back and the node returns it as a STRING. Under the hood the drivers use plain requests against each provider's HTTP API - there's no SDK to install, which keeps this pack's dependency footprint tiny. Ollama goes to http://localhost:11434 and needs no key, so you can run the whole chain offline.

Inputs and output

  • agent (AGENT) - from Simple LLM Agent. It carries the provider, model, temperature, max tokens, and API key, so this node's widget surface stays minimal.
  • prompt (multiline STRING) - the actual thing you're asking. This is where you'd splice in the output of a RAG query or any other text your graph produced.

Output is a single STRING - the model's reply - which you can feed into a display node, a text processor, or straight back into another part of the workflow as a generated prompt.

The failure modes you'll actually hit

Because the drivers are bare requests calls, errors come back as strings, not exceptions: "Error: OpenAI API key not set. Please set OPENAI_API_KEY..." on the output wire. That's honestly pretty debuggable, but there are two subtler traps:

  • No retry logic and a 30-second timeout. A slow or rate-limited provider returns an error string. For an interactive workflow that's fine; for a batch job it means babysitting.
  • The response is a string, not a structured object. You'll be parsing model output with whatever string tools you have. If you ask for JSON, you'll get JSON inside a string and have to deal with it.

Installing it

It ships in ComfyUI-NS-Util:

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

or ComfyUI Manager → Install via Git URL with the same URL, then restart ComfyUI. No models download. Set OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY as environment variables for the cloud providers (or paste keys into the config node); for Ollama, just have it running locally.

The honest take

The README's "Implementing the tests now" warning applies here more than anywhere: this is beta plumbing, with error-as-string and no retries, so don't build a production pipeline on it. But for the 90% case - "I want a language model to write me a prompt inside ComfyUI and let me see it" - it's one of the least fussy options around. Set up an agent once, and every prompt run is a single node.

CategoryNS/LLM/Run

Inputs (2)

NameTypeDefaultDescription
agentAGENT
promptSTRING

Outputs (1)

NameTypeDescription
STRINGSTRING