Nodes/NodeGPT/TextGeneration
ComfyUI Node

TextGeneration

NodeGPT's bare-bones single-shot LLM call

By antonym-git·Created 3 years ago·Updated 2 years ago· 355
TextGeneration
  • LLM
  • TEXT
use_cacheFalse
timeout120
system_messageYou are a helpful AI assistant
PromptYour Prompt

If the rest of NodeGPT is a circus of multi-agent conversation, TextGeneration is the quiet single act: one prompt in, one LLM reply out. No agents, no code execution, no conversation loop. It's the node you'd reach for when all you actually want is a chat-completion call inside a ComfyUI graph - say, rewriting a prompt, generating a caption, or summarizing something - without any of the AutoGen machinery getting involved.

The catch is that it sits in a pack that's been dead since 2024 (the repo now 404s), so "reach for it" is doing a lot of work. For a bare LLM call, modern ComfyUI ships better-maintained options. But if you've got NodeGPT installed and just want the simplest possible text node, this is it.

How it works

TextGeneration reads the LLM object you feed it and checks how that model was loaded. The pack's LLM carries a flag for the local llama.cpp backend. If that flag is set, it calls llama.cpp's create_chat_completion directly. Otherwise it goes through AutoGen's oai.ChatCompletion.create with the OpenAI-compatible config_list - which is how it talks to the LM Studio server the README tells you to run, or to OpenAI/Ollama via the pack's API nodes.

Either way, the mechanics are the same: it builds two messages - a system message plus your prompt - sends them, and returns the first message's content from the response. No streaming, no caching by default, no surprises.

The inputs that matter

  • LLM (required) - the model connection from the pack's API nodes (LM_Studio, ChatGPT, Ollama, oobaboogaOpenAI).
  • Prompt (multiline) - the actual text you're sending. The one you'll type in constantly.
  • system_message - the system role; default is "You are a helpful AI assistant." Change it to steer the reply ("You rewrite prompts for a diffusion model...", "You summarize...", etc.).
  • timeout (default 120) - seconds before giving up on the model. Local models on CPU will need more.
  • use_cache (default "False") - an AutoGen caching toggle. It's typed as a string, which is its own tiny trap: type exactly True (capital T) to enable caching. Any other spelling is silently falsy.

The output

TEXT - a dict ({"TEXT": ...}) on the pack's custom TEXT type, not a raw string. Wire it into the pack's text-display nodes. One footgun: don't feed it into LogAll (TextOutput) and expect it to just save. LogAll reads the LOG key that the pack's Chat node produces; TextGeneration's output has no LOG, so that combination throws a KeyError. TextGeneration's plain reply is meant for display, not for LogAll.

Install

Pack-wide install, from the README:

cd ComfyUI/custom_nodes
git clone https://github.com/xXAdonesXx/NodeGPT

Restart and let ComfyUI attempt the first-boot dependency install (pyautogen, llama-cpp-python, pymemgpt, plus Pillow and websockets pins). Watch out: the repo link currently returns 404 - the author's account went dark and the pack is unmaintained. Manager may still list it, but the clone itself can fail; the Wayback Machine's June 2025 snapshot holds the source.

Common issues

The usual NodeGPT traps apply: output goes to the terminal (ComfyUI's own UI rarely shows it), and the auto-installer is Windows-only, so on Linux/macOS the autogen import can fail and the node never registers - install pyautogen into ComfyUI's environment yourself if that happens. And per the README, don't share workflows with API keys inside them; this pack reads keys from plain-text files.

The one genuinely useful thing here: if you strip away the agents, TextGeneration is a clean, honest chat-completion node that still does exactly what its name says. Just know you're running a museum piece to get it.

CategoryAutoGen

Inputs (5)

NameTypeDefaultDescription
LLMLLM
use_cacheSTRINGFalse
timeoutINT120
system_messageSTRINGYou are a helpful AI assistant
PromptSTRINGYour Prompt

Outputs (1)

NameTypeDescription
TEXTTEXT