ComfyUI Node

Chat

A chat node that just talks to your API

By Moeblack·Created 9 months ago·Updated 7 months ago· 8
Chat
  • config
  • vars
  • text
prompt
system
temperature1.0
max_tokens2048

This is the node the whole pack is named after. Chat (class SimpleChatText) sends a prompt to whatever LLM your API Config node points at and returns the reply as a plain string. OpenAI, Claude, Gemini, or any OpenAI-compatible local server - the provider layer underneath sorts that out, so this node itself is blissfully provider-agnostic. It's the workhorse: generate a prompt, critique your image's prompt, draft a JSON schema, act as a prompt engineer. If you only install one node from this pack, it's this one.

How it works

You feed it a config (from the pack's API Config node), a prompt, and optionally a system message. Before the call goes out, both prompt and system get run through Mustache rendering - so {{var}} placeholders get substituted from a connected vars dict. Then it builds the standard system + user message list and hands it to the provider for the configured model. The reply comes back as text, a STRING you can wire into a Markdown Preview, a JSON Parse, a Mustache Render, or straight into SimpleChatTextInput-style prompt slots elsewhere.

Inputs that matter

  • config - required, from API Config. This is where provider, key, model, and base URL live; the chat node has none of that of its own.
  • prompt - the message (multiline).
  • system - optional system prompt. This is where you'd paste a "you are an Anima prompt engineer" persona to steer output format.
  • vars - optional Mustache variables, so {{width}} in your prompt becomes a real value.
  • temperature - 0 to 2, default 1.0. Drop it toward 0.3 when you need deterministic JSON.
  • max_tokens - default 2048, up to 128000.

Building a real workflow with it

The flagship pattern: Chat → reply is JSON → Prompt JSON Unpack → typed positive/negative/width/steps/cfg/sampler straight into a KSampler. That turns the LLM into a prompt engineer that also picks your sampling parameters, and it's the cleanest LLM-in-the-loop setup this pack offers. Keep a Markdown Preview on a parallel branch to read the raw reply while the parser handles the structured side.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/Moeblack/ComfyUI-SimpleChat

Restart, or use Manager and search "ComfyUI-SimpleChat". The only Python dependency is aiohttp - no models, no weights, nothing to download. You do need an API key and a working connection, which brings us to the gotchas.

Gotchas

The number one failure is "empty dropdown" - the model list is empty because the API key is wrong, the network is blocked, or you forgot to hit the Refresh Models button on API Config. Second: your API key is stored in the workflow. API Config's key is a widget value, so it lands in the workflow JSON and, if you save images, in their metadata. Sharing a workflow with a key pasted in is sharing the key - scrub it first. And remember this node is async: the first call takes a moment and if the provider errors, the node reports it as a failed execution, so check your key and base URL before assuming the node is broken.

CategorySimpleChat

Inputs (6)

NameTypeDefaultDescription
configSIMPLECHAT_CONFIG
promptSTRING
systemoptSTRING
varsoptSIMPLECHAT_VARS
temperatureoptFLOAT1.00–2
max_tokensoptINT20481–128000

Outputs (1)

NameTypeDescription
textSTRING