Nodes/ComfyUI-YogurtNodes/Chat (Custom Model)
ComfyUI Node

Chat (Custom Model)

For the Model That Shipped After the Pack Did

By yogurt7771·Created 2 years ago·Updated 6 days ago· 3
Chat (Custom Model)
  • images
  • history
  • provider
  • text
  • thought
  • history
◄prompt►
◄model▾►
◄seed0►
◄extra►
◄retry_count1►
◄system_prompt►

Every builder of model nodes has the same problem: the vendors ship faster than the node's dropdown can be updated. This node is the answer - a chat node with no built-in model list at all. You pick a provider, type the model ID yourself, and it calls it. One node ID to remember instead of a reinstall every time a new model comes out.

It's also the node you reach for when you've pointed the pack at something it never intended: a local Ollama server, an LM Studio instance, a gateway, an OpenRouter-only model, or one of the smaller relay providers this pack supports that have no first-party model family of their own.

How it picks a route

Worth understanding, because it explains most of the errors. The provider node you connect carries a kind (say openai_compatible) and declares which protocols it speaks per task - for chat, usually openai_chat. This node requires that declaration to exist; if the provider declares no chat protocol, it refuses outright with "provider does not support custom text models." Otherwise it wraps your typed model_id in a request using that protocol. There's no model table, so there's no validation beyond "does the endpoint accept this string."

Which means: whatever model ID you type is passed through verbatim. gpt-4o on an OpenAI-compatible endpoint, llama3.1:8b on a local Ollama, whatever your gateway expects. Get the string wrong and the error comes back from the server, not from ComfyUI.

The inputs

  • prompt - the user turn. Multiline.
  • model - a dynamic combo whose only fixed entry is Custom model; selecting it reveals a model_id text field and the extra parameters that come with it (reasoning_effort, temperature, top_p, max_output_tokens). Those extras are sent only when they're not at their "off/default" value, so you can leave them alone on endpoints that would choke on them.
  • seed - 0 means let the API decide; anything else is passed where supported and forces a re-run when changed.
  • images - autogrow vision input, up to 16. Batches expand, so one batch of 3 costs 3 slots. Vision only works if the model behind your ID is multimodal; nothing here checks that for you.
  • system_prompt - where you fight the preamble problem. "Return only the prompt text."
  • history - optional previous turns, for chained multi-step prompt work.
  • extra - JSON object, merged raw into the request body. This is your escape hatch for parameters the pack hasn't exposed at all.
  • retry_count - total attempts, ~3s apart.

Outputs: text, thought (reasoning text where the endpoint reports it, often empty), and history.

Install and configure

Manager or:

cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes
cd ComfyUI-YogurtNodes
pip install -r requirements.txt

The important part with a custom-model node is the provider, not a key file. Put your endpoint on a Provider: OpenAI Compatible node (base URL including /v1, key filled in on the node itself) and wire its provider output here. If you leave the provider socket empty, this node falls back to the pack's default for chat - official OpenAI, reading openai from api_key.json or OPENAI_API_KEY. That default surprises people: they wire up a local server, forget the provider link, and quietly get billed by OpenAI instead.

{ "openai": "sk-...", "openai_base_url": "http://127.0.0.1:11434/v1" }

That JSON route works too, and openai_base_url is read as the fallback base URL for the official OpenAI provider.

Where this lands in a real workflow

Prompt enhancement is the main one, and the local-server variant is the interesting version: an uncensored 8B behind Ollama costs nothing per call, works offline, and doesn't refuse the prompt you actually wanted. Wire it before your text encoder and you've removed the blank-page problem without paying per call (the KB's llm-in-comfyui.md covers why this is the local path's whole argument).

Also worth using for captioning a small set and for reshaping text between nodes - this node composes with the pack's string and JSON logic nodes, and history out means you can build a conversation without any custom code.

Traps

Two hosts, one key. Because compatible providers never fall back to official keys, you have to type the key in. That's a deliberate safety choice and a good one - it stops a relay from silently receiving your OpenAI key. The cost is that a blank field here means an error rather than a fallback.

Model ID case sensitivity. Endpoints differ; Llama3.1:8B and llama3.1:8b are not the same string to every server.

Thinking models. A reasoner will happily put its deliberation in thought and its actual answer in text, or vice versa depending on the endpoint. If your output looks like a monologue, check thought before you blame the prompt.

No caching. These nodes re-run when inputs change, and an API call is never free. Iterating on a graph with an LLM node in it costs money every time you hit queue.

CategoryYogurtNodes/LLM/Text

Inputs (9)

NameTypeDefaultDescription
promptSTRINGPrompt sent to the model.
modelCOMBOModel version; the inputs below change with the selected model.
seedINT00–2147483647Sent to the API when the model supports it; changing it also forces a re-run. 0 lets the API pick a random seed.
extraSTRINGOptional JSON object merged into the request (for parameters not exposed as inputs).
imagesCOMFY_AUTOGROW_V3Optional reference image(s); batches are expanded. Up to 16.
retry_countINT11–10Total attempts on failure.
system_promptoptSTRINGSystem instruction sent with the request.
historyoptHISTORYPrevious turns.
provideroptYOGURT_LLM_PROVIDERProvider node. When unconnected, the official API is used with keys from api_key.json or environment variables.

Outputs (3)

NameTypeDescription
textSTRING—
thoughtSTRING—
historyHISTORY—