Nodes/NInfer API/NInfer - Temperature
ComfyUI Node

NInfer - Temperature

The one knob worth actually understanding

By kaerozhi·Created 22 days ago·Updated 22 days ago· 1
NInfer - Temperature
  • other_options
  • Options
◄temperature0.70►

Temperature scales the model's output distribution before it picks a token. Low means it almost always takes the highest-probability continuation; high flattens the distribution so unlikely words get a real chance. Everything else in this pack's options chain is a refinement of that sentence.

You already know this shape of knob - diffusion has its own temperature and it fills much the same role - but the sensible range is different. Anything above roughly 1.2 in a chat model starts producing text that reads like it's been drinking, which is not the effect you want when the output is going to be a prompt that then gets encoded by a second model.

Inputs and output

  • Temperature - float, 0.0 to 2.0, step 0.05, default 0.7.
  • Options (optional input, and the output) - the settings chain. The node copies whatever dictionary it was handed and writes temperature into it.

That merge is how the whole option family works, and it's why the chain is relaxed about ordering. Each node adds exactly one key. Chain System Prompt → Temperature → Max Tokens and you get all three; drop the middle node and you get the other two; there's no accumulator to reset and no "correct order" to learn. The only thing that matters is that the last node's Options output reaches the Chat node's options input - the middle of the chain can be wired in any order you like.

What to set it to

For the jobs this pack exists for - rewriting a rough idea into a structured prompt, describing a reference image, producing a caption - go low. Somewhere around 0.3 to 0.5. You want format compliance and obedience, not flair, and the model doesn't need to be original: it needs to pick the word that fits, every time, in the same structure. The mid-0.7 default is a general chat setting, not a prompt-engineering setting.

Turn it up when the LLM's output is the product - dialogue for a video clip, prose, brainstorming ten variant prompts where you want them genuinely different from each other. When you specifically want variation, dropping Temperature to zero and changing the seed is usually the better move: you get the same distribution of ideas without the incoherence.

Two rules of thumb from hard-won experience:

Don't tune temperature and Top P and Top K all at once. If the output is bad you'll have no idea which knob did it. Move one, re-run with Force Regen on, look.

Zero is not "deterministic". Temperature 0 makes the model greedy, but greedy decoding plus a server-side batch or a different kernel can still shift a token, and any change upstream in the prompt changes everything anyway. If you're chasing repeatability, that's the Seed node's job - and remember that the Chat node's cache will happily hand you the previous answer instead of a new generation if Force Regen is off.

One practical note on this specific server: it's a thinking model. If you set Max Tokens low, temperature barely gets a say, because the sampling budget is being spent on hidden reasoning. Fix the budget first, then judge the temperature.

CategoryNInfer/Options

Inputs (2)

NameTypeDefaultDescription
temperatureFLOAT0.700–2—
other_optionsoptNINFER_OPTIONSOptions from the previous settings node

Outputs (1)

NameTypeDescription
OptionsNINFER_OPTIONSMerged settings