ComfyUI Node

Ollama Configuration

A settings object for Ollama-style LLM calls, with a cold-start-sized timeout

By turnbros·Created 11 months ago·Updated 10 months ago· 0
Ollama Configuration
    • OLLAMA_CONFIG
    max_tokens512
    temperature0.7
    seed-1
    control_after_generatefixed
    read_timeout240

    Ollama Configuration builds a single configuration object - OLLAMA_CONFIG - that bundles the sampling and timeout settings for an LLM call. It's one half of the pack's LLM plumbing: this node produces the "how to generate" settings, a companion connection node produces the "where to send it," and the pack's Ollama Converse node consumes both. On its own it does nothing visible; it's a struct builder.

    That sounds underwhelming until you think about how LLM nodes normally look in ComfyUI - a wall of samplers, temperature, and timeout widgets crammed onto one box. This pack's design splits those into a named config object you can build once, wire in, and reuse across multiple chat calls. If you want every LLM node in your workflow to share the same temperature and timeout, you set it here once instead of re-tweaking five widgets. It's the same "shared knob" logic as a constant node, but for a bundle of settings.

    The inputs

    • max_tokens - 1–4096, default 512. The ceiling on response length.
    • temperature - 0–2, default 0.7. Standard LLM creativity dial.
    • seed - default -1 (random). Set a fixed value for reproducible responses.
    • control_after_generate - fixed or randomize. This is the behavior that makes seed useful: keep it fixed to repeat the same seed, or randomize to roll a new one each run - a pattern you'll recognize from sampler seed nodes.
    • read_timeout - 1–600 seconds, default 240. The code comment is the best documentation in the pack: it defaults to 240 because "that seems to be how long a coldstart takes." This isn't a conservative number pulled from thin air; it's tuned for RunPod serverless cold starts.

    Output

    One output: OLLAMA_CONFIG, a custom object type. It carries the settings as a dict that the consuming node reads. There's nothing else to wire it to in the pack besides the Ollama Converse node - if you're not using that, this config has nowhere to go.

    Installing it

    ComfyBros installs like any custom node pack. ComfyUI Manager - search "ComfyBros" - or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/turnbros/ComfyBros
    

    Then restart ComfyUI. The README references a requirements.txt that doesn't exist; the declared deps are in pyproject.toml. The node lives under ComfyBros/LLM.

    Gotchas

    The one to internalize: this is a config node, not a chat node. Beginners wire it up, run, see nothing happen, and assume it's broken. It's not - it's building an object for another node to consume. And remember the read_timeout default exists because of serverless cold starts; if you're pointed at a warm, always-on endpoint you can dial it down, but if you keep hitting timeouts on a cold endpoint, raise it toward 600 before you blame the network.

    CategoryComfyBros/LLM

    Inputs (5)

    NameTypeDefaultDescription
    max_tokensINT5121–4096
    temperatureFLOAT0.70–2
    seedINT-1-1–2147483647
    control_after_generateCOMBOfixed2 options: fixed, randomize
    read_timeoutINT2401–600

    Outputs (1)

    NameTypeDescription
    OLLAMA_CONFIGOLLAMA_CONFIG