Nodes/ComfyUI-YALLM-node/LLM Temperature
ComfyUI Node

LLM Temperature

The sampler knob you'll actually set, and why it's the safest first move

By asaddi·Created 2 years ago·Updated 13 days ago· 7
LLM Temperature
  • previous
  • llm_sampler
temperature0.80

LLM Temperature is the sampler node you'll reach for first, because temperature is the one sampling knob almost every LLM API actually honors. In the YALLM pack, sampling isn't built into the chat node - it's a chain you build yourself, and this node is one link in that chain. You set a value, you optionally chain it onto the previous link, and you get an llm_sampler connection to feed the pack's LLM Chat node.

How sampling works here

The YALLM philosophy is explicit in the README: it only uses the chat-completion API endpoint, and samplers are passed through to the provider. Each sampler node is a tiny thing that appends its (name, value) pair to a list - chain LLM Temperature into LLM Top-K into LLM Min-P and you get an ordered list of settings, not a pile of parallel knobs.

That order matters, and it's a llama.cpp thing. llama.cpp's server accepts a samplers array that says which sampling stages run in which sequence, and the README warns that the order you chain these nodes is the order they're applied. If you're running local llama.cpp, chain deliberately: min-p before top-k, or whichever pipeline you actually want. Other OpenAI-compatible providers may or may not respect the ordering - the OpenAI API spec only officially supports temperature and top-p, so everything else is best-effort per provider.

The inputs and output

  • temperature - a float, default 0.8, minimum 0. Lower is more deterministic and repetitive; higher is more varied and sometimes deranged. Default 0.8 is a fine starting point.
  • previous (optional) - the llm_sampler output of an earlier sampler node, to build the chain.
  • Output: llm_sampler, which feeds into LLM Chat's sampler input.

There's no max on the widget in the schema, but 1.0–1.3 is already spicy territory for most models, and past 2.0 you're mostly generating word salad. Temperature is also the one sampler that goes into the official OpenAI request body rather than an extra body field, which is exactly why it's the safe first thing to touch: it works on basically every provider that speaks the API.

Installing it

It ships with ComfyUI-YALLM-node - Manager searching "ComfyUI-YALLM-node", or:

cd ComfyUI/custom_nodes
git clone https://github.com/asaddi/ComfyUI-YALLM-node
cd ComfyUI-YALLM-node
pip install -r requirements.txt

Restart, and look under YALLM/samplers.

Gotchas

Two things bite people. First, if you don't chain any sampler node at all, LLM Chat runs with whatever the provider defaults to - usually fine, but you get no determinism control beyond the seed. Second, temperature alone can feel like it's "not working" on llama.cpp because it's one stage in a pipeline; if you also set top-k and min-p, their interaction swamps it. The fix isn't to crank temperature to 1.5, it's to relax the other stages or check the sampler order. Start at the defaults, nudge by 0.1, and let the chain do the rest.

CategoryYALLM/samplers

Inputs (2)

NameTypeDefaultDescription
temperatureFLOAT0.80
previousoptLLMSAMPLER

Outputs (1)

NameTypeDescription
llm_samplerLLMSAMPLER