Nodes/ComfyUI Ollama/Ollama Generate Advance (deprecated)
ComfyUI Node

Ollama Generate Advance (deprecated)

The kitchen-sink V1 generate node behind most 2024 'LLM writes my prompt' workflows (deprecated)

By stavsap·Created 2 years ago·Updated 10 months ago· 854
Ollama Generate Advance (deprecated)
    • response
    • context
    promptWhat is Art?
    debugfalse
    urlhttp://127.0.0.1:11434
    model
    systemYou are an art expert, gracefully describing your knowledge in art domain.
    seed599135354
    top_k40
    top_p0.90
    temperature0.80
    num_predict-1
    tfs_z1.00
    keep_alive5
    keep_contextfalse
    format
    filter_thinkingtrue
    context

    Before this pack split into Connectivity + Options + Generate, there was one node that did everything: system prompt, user prompt, full sampling controls, and context carryover, all on a single node. That's OllamaGenerateAdvance. It's deprecated now, but it's genuinely the node behind a lot of the early "hook an LLM up to write my Stable Diffusion prompt" tutorials - one real example from mid-2024 chains it directly into a Math Expression and Show Text node from pythongosssss's Custom-Scripts pack, using an LLM to generate the actual prompt text fed to the image model.

    Why it exists (and why it's deprecated)

    Unlike the plain OllamaGenerate, this node exposes its sampling settings - temperature, top_k, top_p, and so on - directly on itself rather than needing a separate Options node. That made it the more capable V1 option, but the same problem applies as with every other V1 node: url, model, and every sampling knob live on the node itself, so a multi-step workflow means retyping the same server settings over and over. OllamaConnectivityV2 and OllamaOptionsV2 exist to fix exactly that duplication, and the pack's guidance is to move to those plus OllamaGenerateV2 going forward.

    Inputs and outputs that matter

    • prompt and system (default: "You are an art expert, gracefully describing your knowledge in art domain.") - the two fields you'll actually write into.
    • seed, temperature (default 0.8), top_k (default 40), top_p (default 0.9), num_predict (default -1, unlimited), tfs_z - the full sampling bundle that on the V2 side lives in a separate Options node. Leave these at defaults unless output is too repetitive (raise temperature) or you need determinism (fix the seed).
    • keep_context (bool) plus the optional context input (STRING) - turn keep_context on, wire this node's own context output back into its context input, and you get a running conversation across repeated executions.
    • filter_thinking (default true) - strips a reasoning model's internal scratchpad from the response automatically.
    • format - text/json/unset.
    • Outputs: response (the answer) and context (STRING) - that STRING context is also exactly what OllamaSaveContext/OllamaLoadContext are built to persist to disk between sessions.

    Installing it

    Via ComfyUI Manager: search comfyui-ollama (by Stav Sapir), or ollamastavsap. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/stavsap/comfyui-ollama
    pip install -r requirements.txt
    

    then restart ComfyUI. You'll separately need Ollama running and reachable - curl script on Linux, desktop app on Mac/Windows, or Docker - with a model already pulled.

    Common issues

    Multiple validation errors at once on a shared workflow. This is the recurring one for this specific node, and there's a real, documented example of it: someone reused a workflow built on a different setup and hit three errors simultaneously - the saved model name wasn't in their local list, temperature came in below the node's minimum of 0 (it had been saved as -1 from elsewhere), and keep_alive was an empty string instead of a valid option. None of those are subtle config problems; they're all "the workflow was built on someone else's server, not yours." The practical fix people landed on: delete the node and re-add a fresh one from the menu so it pulls your actual model list, then manually re-check every value rather than trusting what the JSON brought with it.

    Context not persisting across ComfyUI restarts. keep_context only holds state while the node instance stays alive in a running session. To survive a restart, route the context output through OllamaSaveContext, and load it back later with OllamaLoadContext.

    No further updates. Vision, chained meta, and per-call Options nodes never landed on this one and won't - that's what OllamaGenerateV2 is for.

    CategoryOllama

    Inputs (16)

    NameTypeDefaultDescription
    promptSTRINGWhat is Art?
    debugBOOLEANfalse
    urlSTRINGhttp://127.0.0.1:11434
    modelCOMBO0 options:
    systemSTRINGYou are an art expert, gracefully describing your knowledge in art domain.
    seedINT5991353540–2147483648
    top_kINT400–100
    top_pFLOAT0.900–1
    temperatureFLOAT0.800–1
    num_predictINT-1-2–2048
    tfs_zFLOAT1.001–1000
    keep_aliveINT5-1–60
    keep_contextBOOLEANfalse
    formatCOMBO3 options: text, json,
    filter_thinkingBOOLEANtrue
    contextoptSTRING

    Outputs (2)

    NameTypeDescription
    responseSTRING
    contextSTRING