Ollama Options
The sampler-settings node for your local LLM calls
- options
If OllamaConnectivityV2 is the checkpoint loader for your LLM setup, this is the sampler node - the bundle of generation knobs (temperature, top_k, top_p, mirostat, and a dozen more) that map directly onto Ollama's own API options. Plug its output into the options input on OllamaGenerateV2 or OllamaChat and every option you've turned on rides along with the request. The pack's own docs point straight at Ollama's Modelfile parameter table for what each one does - this node is just a ComfyUI-shaped front end for that same list, plus one extra field that isn't part of Ollama at all.
How it works
Every option here comes as a pair: the value itself, and an enable_<name> boolean next to it. If the enable toggle is off, the value is ignored completely - Ollama falls back to its own defaults regardless of what the slider says. This is the single most important thing to understand about this node, because it's also the most common way to get confused by it: cranking temperature up and seeing no change in the output almost always means enable_temperature was never flipped on.
The options a beginner will actually touch
temperature(default 0.8) - higher makes the model more creative/random, lower makes it more deterministic.top_k(default 40) andtop_p(default 0.9) - work together to control how wide a net the model casts when picking the next token. Higher values, more variety; lower, more focused and repetitive-safe.num_predict(default -1, meaning unlimited) - caps how many tokens the model can generate. Set this if a model tends to ramble past where you want it to stop.num_ctx(default 2048) - the context window: how much of your system prompt + conversation history the model can actually see at once. If responses seem to "forget" earlier instructions, this is usually why - raise it, at the cost of more memory on the Ollama side.seed- fix this for reproducible output on the same prompt.repeat_penalty(default 1.1) andrepeat_last_n(default 64) - how hard the model is penalized for repeating itself, and how far back it looks to check.stop- a string that, once generated, halts output immediately.
Beyond those, you've got mirostat / mirostat_eta / mirostat_tau (an alternative sampling algorithm to top_k/top_p that actively targets a text-quality range - leave disabled unless you specifically want it), min_p (a newer alternative to top_p), and tfs_z. All of them follow the same enable-to-activate pattern.
One field that isn't an Ollama option at all: debug. It's the pack author's own addition, purely for extra console output from the custom node - it does nothing to the actual API call.
Output: a single options socket (type OLLAMA_OPTIONS).
Installing it
Via ComfyUI Manager, search comfyui-ollama (by Stav Sapir) or ollama → stavsap. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/stavsap/comfyui-ollama
pip install -r requirements.txt
then restart. This node doesn't talk to Ollama itself - it just builds a settings bundle - so there's nothing extra to install for it specifically beyond the pack and a running Ollama server for the Generate/Chat node downstream to actually use it against.
Common issues
"I changed a setting and nothing happened." Check the matching enable_ toggle. Every value on this node is inert until its toggle is on.
Responses feel like they've forgotten the system prompt. Enable num_ctx and raise it. The default 2048 is small enough that a long system prompt plus a growing conversation history can genuinely run out of room, and the model just won't see the earlier parts anymore.
Stacking mirostat with top_k/top_p. These are two different sampling strategies, not complementary settings - turning on mirostat and leaving top_k/top_p enabled isn't wrong exactly, but it's not a combination with a clear, well-understood effect either. If you don't have a specific reason to use mirostat, leave it off and stick to temperature/top_k/top_p, which is what most models are tuned around.
Inputs (29)
| Name | Type | Default | Description |
|---|---|---|---|
| enable_mirostat | BOOLEAN | false | — |
| mirostat | INT | 00–2 | Whether to use Mirostat sampling. Mirostat is an algorithm that actively maintains the quality of generated text within a desired range during text generation. (0 = disabled, 1 = Mirostat 1, 2 = Mirostat 2.0) |
| enable_mirostat_eta | BOOLEAN | false | — |
| mirostat_eta | FLOAT | 0.1 | Mirostat's learning rate parameter influences how quickly the algorithm responds to feedback from the generated text. |
| enable_mirostat_tau | BOOLEAN | false | — |
| mirostat_tau | FLOAT | 5.0 | Mirostat's target entropy parameter controls the balance between coherence and diversity in the generated text. |
| enable_num_ctx | BOOLEAN | false | — |
| num_ctx | INT | 20480–2147483648 | Sets the size of the context window used to generate the next token. |
| enable_repeat_last_n | BOOLEAN | false | — |
| repeat_last_n | INT | 64-1–64 | Sets how far back for the model to look back to prevent repetition. (0 = disabled, -1 = num_ctx) |
| enable_repeat_penalty | BOOLEAN | false | — |
| repeat_penalty | FLOAT | 1.100–2 | Sets how strongly to penalize repetitions. A higher value (e.g., 1.5) will penalize repetitions more strongly, while a lower value (e.g., 0.9) will be more lenient. |
| enable_temperature | BOOLEAN | false | — |
| temperature | FLOAT | 0.80-10–10 | Increasing the temperature will make the model answer more creatively. |
| enable_seed | BOOLEAN | false | — |
| seed | INT | 15300899740–2147483648 | Sets the random number seed to use for generation. Setting this to a specific number will make the model generate the same text for the same prompt. |
| enable_stop | BOOLEAN | false | — |
| stop | STRING | When this pattern is encountered the LLM will stop generating text and return. | |
| enable_tfs_z | BOOLEAN | false | — |
| tfs_z | FLOAT | 1.001–1000 | — |
| enable_num_predict | BOOLEAN | false | — |
| num_predict | INT | -1-2–2048 | Maximum number of tokens to predict when generating text. The default -1 means infinite generation. |
| enable_top_k | BOOLEAN | false | — |
| top_k | INT | 400–100 | Reduces the probability of generating nonsense. A higher value (e.g. 100) will give more diverse answers, while a lower value (e.g. 10) will be more conservative. |
| enable_top_p | BOOLEAN | false | — |
| top_p | FLOAT | 0.900–1 | Works together with top-k. A higher value (e.g., 0.95) will lead to more diverse text, while a lower value (e.g., 0.5) will generate more focused and conservative text. |
| enable_min_p | BOOLEAN | false | — |
| min_p | FLOAT | 0.000–1 | Alternative to the top_p, and aims to ensure a balance of quality and variety. The parameter p represents the minimum probability for a token to be considered, relative to the probability of the most likely token. For example, with p=0.05 and the most likely token having a probability of 0.9, logits with a value less than 0.045 are filtered out. |
| debug | BOOLEAN | false | For debugging purposes of the custom nodes, no effect on ollama api. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| options | OLLAMA_OPTIONS | — |