Ollama Image List Options
Ollama options without the guesswork — disabled means omitted
- options
- options_json
Every Ollama options object is a dictionary of tuning parameters, and the fiddly part is that a parameter you leave at its default still gets sent - which can silently override whatever sensible default your model actually ships with. The Ollama Image List Options node fixes that the blunt way: each parameter has an Include/Ignore toggle in front of its value widget, and disabled parameters are simply omitted from the request. Nothing is sent with a displayed default you didn't ask for. That's more disciplined than the raw API.
The node is a long grid of toggle-plus-value pairs, ordered exactly as num_ctx, num_predict, temperature, top_p, top_k, min_p, repeat_penalty, repeat_last_n, seed, stop, and draft_num_predict. Each use_* boolean controls whether that parameter lands in the output dictionary. The defaults are Ollama's documented ones - num_ctx 2048, temperature 0.8, top_p 0.9, repeat_penalty 1.1, repeat_last_n 64 - so the widget values are honest references rather than arbitrary starts.
Two parameters deserve a closer look because they're easy to misuse. num_predict is capped at -1, which in Ollama means unlimited generation - set it with intent, or a long prompt plus an image can turn into a very long wait. And stop is a single string here, but the Ollama API wants an array; the node handles the conversion for you, encoding your one string into the required one-item array in both outputs.
There are two outputs, and they serve different masters. options is a typed DICT you connect straight into the Generate node's options input - that's the normal path. options_json is the same content as a JSON string, for debugging, manual inspection, or feeding a string-based utility node. If you're ever confused about what actually went over the wire, look at options_json and it'll be obvious which toggles you left on.
The one precedence rule matters more than it looks: in Generate, a connected options dictionary always wins over a hand-written options_json, including an empty dictionary. So if you connect this node and see output that ignores your options_json text elsewhere in the workflow, that's the design, not a bug - disconnect the DICT to fall back to the manual JSON.
Wiring it up:
# install the pack (or use Manager → search "Ollama Image List")
cd ComfyUI/custom_nodes
git clone https://github.com/craftingmod/ComfyUI-Ollama-ImageList
Then restart ComfyUI, drop Options before Generate, and flip on only what you want to tune. My usual starting set is temperature, top_p, num_ctx (vision models want more than 2048 context), and seed when I want reproducibility.
A genuinely thin node, this one - there's no hidden complexity. But the "disabled means omitted" philosophy is the reason it exists and the thing to remember: when you're chasing a weird response, first check which toggles you accidentally left on, because the value sitting in the widget is not the value being sent unless its toggle is on.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| use_num_ctx | BOOLEAN | false | Include num_ctx in the generated Ollama options object. |
| num_ctx | INT | 20481–2147483647 | Context window size in tokens. Ollama documented default: 2048. |
| use_num_predict | BOOLEAN | false | Include num_predict in the generated Ollama options object. |
| num_predict | INT | -1-1–2147483647 | Maximum generated tokens. -1 means unlimited generation. |
| use_temperature | BOOLEAN | false | Include temperature in the generated Ollama options object. |
| temperature | FLOAT | 0.800–10 | Sampling temperature. Ollama documented default: 0.8. |
| use_top_p | BOOLEAN | false | Include top_p in the generated Ollama options object. |
| top_p | FLOAT | 0.900–1 | Nucleus sampling probability. Ollama documented default: 0.9. |
| use_top_k | BOOLEAN | false | Include top_k in the generated Ollama options object. |
| top_k | INT | 400–2147483647 | Number of highest-probability tokens considered during sampling. |
| use_min_p | BOOLEAN | false | Include min_p in the generated Ollama options object. |
| min_p | FLOAT | 0.000–1 | Minimum token probability relative to the most likely token. |
| use_repeat_penalty | BOOLEAN | false | Include repeat_penalty in the generated Ollama options object. |
| repeat_penalty | FLOAT | 1.100–10 | Penalty applied to repeated tokens. Ollama documented default: 1.1. |
| use_repeat_last_n | BOOLEAN | false | Include repeat_last_n in the generated Ollama options object. |
| repeat_last_n | INT | 64-1–2147483647 | Lookback for repetition penalties. 0 disables; -1 uses num_ctx. |
| use_seed | BOOLEAN | false | Include seed in the generated Ollama options object. |
| seed | INT | 00–2147483647 | Random seed. A fixed value makes identical prompts reproducible. |
| use_stop | BOOLEAN | false | Include stop in the generated Ollama options object. |
| stop | STRING | Single stop sequence. The JSON output converts this string to the array required by the Ollama API. | |
| use_draft_num_predict | BOOLEAN | false | Include draft_num_predict in the generated Ollama options object. |
| draft_num_predict | INT | 40–2147483647 | Maximum speculative draft tokens per step. 0 disables speculative drafting. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| options | DICT | — |
| options_json | STRING | — |