Nodes/Kinburg-Nodes/Local LLM Settings (GGUF)
ComfyUI Node

Local LLM Settings (GGUF)

One Config Node to Rule All Your Local Models

By Kinburg·Created 3 months ago·Updated 6 days ago· 1
Local LLM Settings (GGUF)
  • vision
  • config
model
model_path
system_promptYou are a helpful assistant.
max_tokens512
temperature0.70
top_p0.95
top_k40
min_p0.00
repeat_penalty1.10
stop
n_ctx4096
n_gpu_layers-1
n_batch512
flash_attnfalse
kv_cache_typef16
seed0
unload_comfy_modelstrue
unload_llm_after_runfalse
strip_thinktrue
answer_marker
thinking_directivemodel default
custom_directive
output_formattext
grammar
extra_load_args
chat_template_path
enable_thinkingmodel default
reasoning_effortmodel default
reasoning_effort_custom
context

Every LLM node in the Kinburg pack - Local LLM (GGUF), the chat node, Token Counter, Context Sizer - takes its orders from one place: Local LLM Settings (GGUF). It's the config node that carries the model, the system prompt, the sampling, the context size, the reasoning control, and the output format, then emits the whole lot as a single config bundle. One of these can drive several LLM nodes at once, which means you change the model once and every consumer follows. It's the node you'll spend your time on, so it's worth knowing what's actually in it.

What you'll actually set

  • model / model_path - pick the .gguf from ComfyUI/models/llm (subfolders show as folder/model.gguf), or type a path in model_path via the placeholder. Quotes from Windows "Copy as path" are stripped automatically.
  • system_prompt - who the model is. This is where the job gets defined.
  • max_tokens, temperature, top_p, top_k, min_p, repeat_penalty, stop - the sampling basics. min_p of ~0.05 is a good start, often paired with top_p=1.0, top_k=0. Stop strings go one per line.
  • n_ctx - context size. The KV cache shrinks with it, so don't just max it out.
  • n_gpu_layers - -1 = all layers on GPU, 0 = all CPU.
  • flash_attn, kv_cache_type - flash attention is faster and uses less VRAM; quantizing the KV cache (q8_0/q4_0) fits a bigger context in the same card. Both auto-enable each other as needed.
  • unload_comfy_models - frees image models from VRAM before the LLM runs. unload_llm_after_run - free the LLM after each run; off (default) keeps it warm for chat, turn it on in image workflows.

Reasoning control - the modern stuff

Modern reasoning models are switched inside the chat template, not by anything you say in the prompt. enable_thinking (model default / on / off) and reasoning_effort are handed to the model's own Jinja template as variables, so the model can't ignore them. Big caveat: model default is not off - Qwen3.5/3.8 take an undefined variable as thinking ON, Gemma-4 as OFF. The older thinking_directive (appends /no_think to the prompt) only works on original Qwen3; newer models ignore it. strip_think keeps reasoning out of the text output (it still goes to thoughts), and answer_marker handles models that reason without <think> tags.

Structured output & advanced

output_format - free text, valid JSON, a custom GBNF grammar, or ideogram4_json (a built-in prompt grammar). Grammar runs skip the live progress bar. extra_load_args passes Python-binding args to llama-cpp-python's Llama() loader (n_threads=8, main_gpu=0, tensor_split=[1,1]), one key=value per line - note these are binding args, not llama.cpp CLI flags, so --spec-type won't work here. chat_template_path overrides a broken embedded chat template; leave it empty for well-packaged models. Optional connect-only inputs: context (reference material appended to the system prompt) and vision (from a Vision Settings node). Output is just config.

Install

Pack install via ComfyUI Manager (search "Kinburg-Nodes") or git clone. Needs llama-cpp-python - Manager runs install.py automatically, or run <ComfyUI>/.venv/Scripts/python.exe <ComfyUI>/custom_nodes/Kinburg-Nodes/install.py by hand. The wheel's CUDA major must match your torch's, or you get the cudart64_12.dll load failure. One config node to change, several LLM nodes that follow - that's the whole design, and it's a good one.

CategoryKinburg-Nodes/LLM

Inputs (31)

NameTypeDefaultDescription
modelCOMBOPick a .gguf from ComfyUI/models/llm (subfolders included — organize models into folders and they show as 'folder/model.gguf'). Choose the placeholder to type any path in model_path
model_pathSTRINGFull path to a .gguf, used when 'model' is the placeholder. Surrounding quotes (e.g. from Windows 'Copy as path') are stripped automatically.
system_promptSTRINGYou are a helpful assistant.
max_tokensINT51216–32768
temperatureFLOAT0.700–2
top_pFLOAT0.950–1
top_kINT400–32768
min_pFLOAT0.000–1Min-p sampling. 0 = off. Try ~0.05 (often paired with top_p=1.0, top_k=0)
repeat_penaltyFLOAT1.101–2
stopSTRINGStop strings, one per line. Generation stops as soon as any is produced
n_ctxINT4096256–1048576
n_gpu_layersINT-1-1–1000-1 = all layers on GPU, 0 = all on CPU
n_batchINT51232–8192
flash_attnBOOLEANfalseFlash Attention: faster and a smaller KV cache (less VRAM)
kv_cache_typeCOMBOf16Quantize the KV cache to fit a bigger context in VRAM. q8_0/q4_0 auto-enable Flash Attention
seedINT0-1–18446744073709550000
unload_comfy_modelsBOOLEANtrueUnload ComfyUI (image) models from VRAM before running the LLM
unload_llm_after_runBOOLEANfalseFree the LLM from VRAM after each run. Off (default) keeps it loaded for fast repeated runs / chat; turn ON in image workflows to free VRAM.
strip_thinkBOOLEANtrueKeep reasoning out of the 'text' output (it still goes to the 'thoughts' output). Off = leave raw reasoning in 'text'
answer_markerSTRINGFor models that print reasoning WITHOUT <think> tags: the answer is taken after the LAST occurrence of this marker, everything before goes to 'thoughts'. Empty = use <think> tags.
thinking_directiveCOMBOmodel defaultAppend a reasoning-control directive to the PROMPT. Only original-Qwen3 models were trained to obey it — for Qwen3.5/3.8, Gemma-4 and gpt-oss use enable_thinking / reasoning_effort below instead. 'custom' uses the field below.
custom_directiveSTRINGDirective text appended to the prompt when thinking_directive = custom (e.g. /no_think)
output_formatCOMBOtextOutput: free text · valid JSON · custom GBNF grammar (field below) · ideogram4_json. Grammar modes run without the live progress bar
grammarSTRINGGBNF grammar text, used when output_format = gbnf_grammar
extra_load_argsSTRINGAdvanced: extra keyword args for llama-cpp-python's Llama() loader. One per line as key=value or a JSON object. These are Python-binding args, NOT llama.cpp CLI flags. Unknown keys are ignored. Changing this reloads the model.
chat_template_pathSTRINGAdvanced: path to a chat_template.jinja file that OVERRIDES the model's built-in chat template. Empty (default) = use the template embedded in the GGUF, which is correct for almost every model. Only needed when a model ships a broken/missing embedded template, or you want a specific template variant. TEXT models only — ignored when an mmproj (vision) is active, since vision uses its own formatting. Surrounding quotes are stripped. Changing this reloads the model.
enable_thinkingCOMBOmodel defaultReasoning switch passed to the model's chat template (Qwen3.5/3.8, Gemma-4, gpt-oss…) — unlike thinking_directive this is not prompt text, so the model cannot ignore it. 'model default' leaves the variable undefined, which each family reads its own way (Qwen3.5/3.8: thinking ON, Gemma-4: OFF). Templates that don't know the variable ignore it.
reasoning_effortCOMBOmodel defaultHow hard the model should think, as a chat-template variable. Qwen3.5/3.8 accept xhigh (their default) / medium / low and ERROR on anything else; use 'custom' for other families (gpt-oss: high). Ignored while thinking is off. 'model default' sends nothing.
reasoning_effort_customSTRINGEffort value sent when reasoning_effort = custom (e.g. 'high' for gpt-oss). Empty = send nothing.
contextoptSTRINGReference material appended to the system prompt — e.g. Character Card / Context Collector output. Connect-only (no text field).
visionoptKINBURG_VISION_CONFIGOptional vision settings — wire a 'Vision Settings (GGUF)' node here to enable vision (mmproj / handler / downscale). Leave unconnected for text-only.

Outputs (1)

NameTypeDescription
configKINBURG_LLM_CONFIG