Nodes/Comfy DV Nodes/Ollama Option — Extra Body
ComfyUI Node

Ollama Option — Extra Body

The escape hatch for every sampling parameter comfydv doesn't have a slider for

By darth-veitcher·Created 2 years ago·Updated about a month ago· 2
Ollama Option — Extra Body
  • options
  • options
extra_body_json{}

Every option pack runs out of knobs. comfydv ships sliders for temperature, seed, top p, top k, max tokens, repeat penalty, and a couple of thinking toggles - but Ollama and llama.cpp expose more parameters than any UI will bother to surface. Ollama Option - Extra Body is the escape hatch: paste in arbitrary JSON and it merges into the options bundle that rides along with your chat request, so anything the backend accepts, you can set.

How it works

It's a dict merge with a JSON parser in front. You give it a multiline extra_body_json field (default "{}"), it parses the JSON, and merges the result into the OLLAMA_OPTIONS chain via the same optional options input every option node shares. Output is the merged options bundle, ready to wire into Chat Completion or the next option node.

So if your backend supports something like repeat_penalty tuning beyond the preset, num_ctx for context length, stop sequences, or mirostat settings - and it isn't already a dedicated node - this is where you set it:

{
  "num_ctx": 8192,
  "stop": ["###", "User:"],
  "repeat_last_n": 128
}

Inputs and output

  • extra_body_json - required, multiline STRING. Must be valid JSON; the node raises a clear "not valid JSON" error if you typo a brace, which is a nicer failure than a silent drop.
  • options (optional) - the chain input, same as every other option node.
  • Output: options.

Where it's worth it and where it's a trap

Worth it: one-off experiments, backend-specific parameters, or settings you're only testing before deciding whether they deserve a saved preset. The escape hatch is exactly what it says on the tin.

Trap: pasting a blob of keys you found in a random workflow or forum post. Parameters that don't exist are usually ignored silently by the server, so a typo'd key does nothing and you'll spend an hour wondering why your setting "isn't working." Validate the key names against your backend's docs first. Also, keys you set here override the dedicated option nodes if they collide - the merge happens after, so Extra Body wins. Keep your blobs scoped to things the dedicated nodes don't already cover.

Install

Via ComfyUI Manager (search "comfydv"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/darth-veitcher/comfydv.git

Restart, run Ollama or llama.cpp, and use it in the standard chain ahead of Chat Completion. Lives under dv/ollama/options.

Categorydv/ollama/options

Inputs (2)

NameTypeDefaultDescription
extra_body_jsonSTRING{}
optionsoptOLLAMA_OPTIONS

Outputs (1)

NameTypeDescription
optionsOLLAMA_OPTIONS