Nodes/Ollama-ImageList/Llama.cpp Thinking / Reasoning Config
ComfyUI Node

Llama.cpp Thinking / Reasoning Config

Thinking, effort and budget — your reasoning controls, decoupled from the model

By craftingmod·Created about a month ago·Updated 11 days ago· 2
Llama.cpp Thinking / Reasoning Config
    • reasoning
    reasoning_modeauto
    reasoning_effortauto
    max_reasoning_tokens0
    preserve_thinkingfalse

    Reasoning models are the part of the LLM world that overpromises for image pipelines - the KB's LLM-in-ComfyUI doc makes the point bluntly: a prompt-enhancer job wants a model that follows a format and stops, not one that thinks out loud and leaks its scratch-work into your output. But some of the GGUFs this pack targets genuinely ship a thinking mode - Qwen 3.5's reasoning variants, Gemma 4's thinking channel - and Llama.cpp Thinking / Reasoning Config is the clean way to control it without scattering toggle widgets across the generate node.

    The whole node is three inputs. reasoning_mode is auto, off, or on. auto leaves the chat-template controls untouched - which is the right default, because it means the model template decides and you're not imposing anything. off and on explicitly disable or enable reasoning for templates that support the switch. reasoning_effort (auto/low/medium/high/xhigh) only applies when mode is on, and it's passed as a hint to templates that understand effort levels. max_reasoning_tokens caps reasoning separately; 0 (the default) means "no separate reasoning limit" - but here's the subtle part the tooltip spells out: reasoning and the final answer still share Generate's max_tokens allowance. A reasoning model that thinks for 2000 tokens and then answers will eat 2000 tokens of your max_tokens budget, so raise it when you enable a serious thinking budget.

    Two interactions are worth internalizing. First, if your Model Profile is one of the Qwen 3.5 pair, that profile already carries a reasoning mode - Qwen 3.5 Thinking wants on, Non-thinking wants off. An explicitly connected opposite mode fails before model loading, which is a deliberate safeguard rather than a silent override war. Second, when the reasoning socket is disconnected, the compact Generate just uses the model's default reasoning behavior - so for a plain Gemma 4 or Qwen 3 VL profile, you can safely ignore this node entirely.

    Output is a single reasoning socket that feeds the reasoning input on either compact Generate or Sequential Generate.

    Pack install, as always:

    cd ComfyUI/custom_nodes
    git clone https://github.com/craftingmod/ComfyUI-Ollama-ImageList
    

    Restart ComfyUI; shared prerequisites apply (JamePeng llama-cpp-python wheel, ComfyUI 0.19.3+).

    My practical take: leave it disconnected until you actually need it. auto/disconnected is the "let the model be itself" state, and for most captioning and enhancement work the thinking channel is overhead you don't want. Reach for this node in exactly two situations - you're on a Qwen 3.5 Thinking profile and want to trim its deliberation with a token budget, or you're using a reasoning model and the scratch-work is bleeding into your response output and you want it off. That's the whole scope, and it's correctly scoped.

    CategoryOllama/llama_cpp/compact

    Inputs (4)

    NameTypeDefaultDescription
    reasoning_modeCOMBOautoauto leaves template controls untouched; off and on explicitly disable or enable reasoning.
    reasoning_effortCOMBOautoUsed only when reasoning_mode is on.
    max_reasoning_tokensINT00–655360 applies no separate reasoning limit. Reasoning and final output still share Generate's max_tokens.
    preserve_thinkingBOOLEANfalsePreserve thinking/reasoning content in the chat history passed to the model.Currently, Qwen3.5+ only and may not work.

    Outputs (1)

    NameTypeDescription
    reasoningOLLAMA_IMAGE_LIST_LLAMA_CPP_REASONING_CONFIG