Nodes/ComfyUI-Local-GGUF-LLM/Local LLM Settings
ComfyUI Node

Local LLM Settings

One wire instead of forty dials

By Solid-Code·Created 20 days ago·Updated a day ago· 2
Local LLM Settings
    • settings
    settings_presetCurrent Server
    model
    vision_model
    model_presetAuto (Detected)
    thinking_modeAuto
    reasoning_effortAuto
    preserve_thinkingtrue
    temperature0.70
    top_p0.90
    top_k40
    min_p0.00
    repeat_penalty1.00
    presence_penalty0.00
    frequency_penalty0.00
    max_tokens4096
    vision_max_images4
    vision_max_frames24
    vision_max_edge1536
    context_size32768
    kv_cache_kq8_0
    kv_cache_vq5_0
    kv_cache_locationGPU
    gpu_layers-1
    flash_attentiontrue
    prompt_batch_size2048
    memory_batch_size512
    use_mmaptrue
    use_mlockfalse
    prompt_cache_modeAuto
    speculative_modeOff
    ngram_pred_tokens10
    ngram_size3
    ngram_modek
    ngram_min_hits2
    ngram_max_entries_per_key8
    ngram_sync_check_tokens16
    mtp_draft_tokens2
    mtp_p_min0.50
    split_modeNone (single GPU)
    main_gpu0 — Default GPU (backend device 0)
    tensor_split
    vram_policyAuto Yield to ComfyUI

    Here's the situation this node exists for. You have a Local LLM Generate node doing a job, and you want a different model or a tighter temperature for one branch of the workflow. Without this node you'd go into the server panel and change global settings, which breaks every other node. With it, the workflow owns its own LLM configuration and carries it down a single wire.

    That's the pattern our plumbing notes call a context object - one bundle travelling one connection instead of a dozen values dragged across the canvas. LOCAL_LLM_SETTINGS is the type. Generate and Prompt Enhancer both accept it, and neither one wants more than one of them.

    How it works

    The node exposes the pack's complete runtime surface as widgets, then build() freezes the relevant subset into a dict and hands it downstream. Consuming nodes treat it as request-local overrides: model, sampler, vision limits and memory knobs all travel with the wire.

    The one thing it deliberately does not carry is the seed, which stays on the consuming node so Control After Generate keeps behaving normally. If you're hunting for a seed widget here, it isn't there.

    Settings come from one of three places, chosen by settings_preset: Current Server (whatever the LLM side panel is set to right now, re-read live), Custom, or a saved Complete Settings Preset from ComfyUI/models/LLM/local_LLM_presets/settings/. A complete preset bundles model + mmproj + model behaviour + sampling + memory/KV/offload/speculative config, and intentionally excludes API keys, startup mode and logging.

    Note the direction of travel: this node can load presets, never create or delete them. Preset creation lives only in the server panel's Presets tab, so a shared workflow can't mutate your preset library.

    The inputs you'll actually set

    There are a lot of widgets here, and most of them you'll leave alone.

    settings_preset first, every time. Pick Current Server to inherit the panel config, or load a saved preset. Now the small print: editing any field flips this to Custom, and with a named preset loaded, the preset file is authoritative for its own fields. Change one value and you've left the preset - expected, just don't be confused when the dropdown doesn't say what you picked.

    model and vision_model - the GGUF and its mmproj. vision_model defaults to None/Auto (matching mmproj); leave it auto unless you've got several projectors in ComfyUI/models/llm and it guesses wrong.

    model_preset is a big dropdown of per-family behaviour - thinking and non-thinking flavours of Qwen3.x, GPT-OSS 20B, a generic chat entry, and Auto (Detected). It applies sampling and chat-template behaviour only and deliberately does not touch max_tokens. If your output is full of leaked thinking tags, this is the dial that fixes it, not the temperature.

    Then the standard sampler set: temperature (0.7), top_p (0.9), top_k (40), min_p, repeat_penalty, presence_penalty / frequency_penalty. Leave these alone until a specific job misbehaves - a prompt rewriter wants low temperature, a brainstorm wants higher.

    The memory half is where the real decisions are: context_size (32768 default, and the KV cache scales with it), kv_cache_k / kv_cache_v (q8_0 / q5_0 - a real VRAM lever at a small quality cost), kv_cache_location, gpu_layers (-1 meaning as many as fit), flash_attention, the two batch sizes, use_mmap / use_mlock, and vram_policy. On a box that also runs diffusion or video, Auto Yield to ComfyUI is the pick.

    Vision limits sit between the two: vision_max_images (4), vision_max_frames (24), vision_max_edge (1536). These aren't just performance caps - the video-planner nodes error rather than silently hide references that exceed them, so a too-low limit is a visible failure, not a quiet one.

    There's also a speculative-decoding block (speculative_mode, off by default, with ngram_*/mtp_* tuning) and a multi-GPU set (split_mode, main_gpu, tensor_split) that defaults to one card. Ignore both on a single GPU.

    The output, and the trap

    One output: settings, which goes into the settings input on Local LLM Generate or Local LLM Prompt Enhancer.

    The trap is the generic cost of context objects: when config travels as one opaque bundle, what's inside it becomes invisible. The plumbing notes put it well - with forty wires you can see the LoRA output isn't feeding the sampler; with one bus you can't, because the connection is there and the contents are wrong. So if a Generate node behaves like it's using the wrong model, expand the Settings node and read its widgets before hunting elsewhere.

    One thing that works better than you'd expect: change tracking. IS_CHANGED follows the live server config under Current Server, and the preset file's modification time when a named preset is selected. Edit the preset in the panel and downstream nodes re-run - no reselecting required.

    Installing it

    Same pack, same install - nothing extra for this node:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Solid-Code/ComfyUI-Local-GGUF-LLM
    pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu124
    

    The second line is on you, not the pack: requirements.txt deliberately installs nothing, so a Manager-run pip install can't replace your GPU build with a CPU-only wheel. Models go under ComfyUI/models/llm/, then start the model from the LLM side panel.

    And the honest recommendation: most people don't need this node. If you run one LLM configuration, leave settings disconnected on Generate - it uses the live server config, and you've skipped a node and a class of stale-config bugs. Reach for Local LLM Settings when two workflows need different models, or when a shared workflow should carry its config instead of depending on the recipient's panel.

    CategoryLLM/Local Service

    Inputs (42)

    NameTypeDefaultDescription
    settings_presetCOMBOCurrent ServerLoad the current Local LLM server settings or a saved Settings Preset. Editing any field switches this node to Custom.
    modelCOMBO1 options: No GGUF models found
    vision_modelCOMBO2 options: None, Auto (matching mmproj)
    model_presetCOMBOAuto (Detected)Applies model-recommended sampling and chat-template behavior only. Editing an owned setting switches this to Custom.
    thinking_modeCOMBOAuto3 options: Auto, Enabled, Disabled
    reasoning_effortCOMBOAuto5 options: Auto, Low, Medium, High, XHigh
    preserve_thinkingBOOLEANtrueQwen3.8 history setting: preserve prior assistant reasoning in future chat turns. This single-shot node normally has no assistant history, so it matters only if history support is added/used. Distinct from response Strip/Keep.
    temperatureFLOAT0.700–5
    top_pFLOAT0.900–1
    top_kINT400–10000
    min_pFLOAT0.000–1
    repeat_penaltyFLOAT1.000–3
    presence_penaltyFLOAT0.00-2–2
    frequency_penaltyFLOAT0.00-2–2
    max_tokensINT4096-1–262144Task-specific generation limit; intentionally not changed by Model Preset.
    vision_max_imagesINT41–32Maximum still images accepted from the IMAGE batch.
    vision_max_framesINT241–1024Evenly sample at most this many frames from the optional Video Frames IMAGE batch.
    vision_max_edgeINT1536256–4096Downscale vision inputs so their longest edge does not exceed this value.
    context_sizeINT327680–1048576
    kv_cache_kCOMBOq8_010 options: Auto, f32, f16, bf16, q8_0, q5_1, +4
    kv_cache_vCOMBOq5_010 options: Auto, f32, f16, bf16, q8_0, q5_1, +4
    kv_cache_locationCOMBOGPU2 options: GPU, CPU
    gpu_layersINT-1-1–999
    flash_attentionBOOLEANtrue
    prompt_batch_sizeINT20481–32768
    memory_batch_sizeINT5121–32768
    use_mmapBOOLEANtrue
    use_mlockBOOLEANfalse
    prompt_cache_modeCOMBOAutoReuse an exact token prefix already present in the resident llama.cpp KV context. Adds no separate RAM cache. Suspend, Stop/Unload, model reload, and vision requests clear or bypass this resident prefix state.
    speculative_modeCOMBOOffLossless speculative decoding. Auto prefers embedded native MTP when both the model and installed binding support it, otherwise falls back to N-gram.
    ngram_pred_tokensINT101–64Maximum N-gram draft tokens proposed per verification step.
    ngram_sizeINT31–16N-gram lookup key length. 3 is a good general starting point.
    ngram_modeCOMBOkk uses less RAM; k4v caches continuations for cheaper lookup and can use more RAM.
    ngram_min_hitsINT21–16Historical matches required before an N-gram draft is proposed.
    ngram_max_entries_per_keyINT80–1024RAM cap per key for supported N-gram map implementations. 0 means unlimited/default.
    ngram_sync_check_tokensINT161–256Trailing tokens used by supported N-gram map implementations to verify incremental history.
    mtp_draft_tokensINT21–8Maximum native MTP draft depth. 2 is a conservative starting point; higher is not always faster.
    mtp_p_minFLOAT0.500–1Minimum MTP draft probability. Higher values stop uncertain drafts earlier and can improve net throughput.
    split_modeCOMBONone (single GPU)Single GPU is simplest. Multi-GPU Layer/Row/Tensor split is supported in Persistent and Unload modes; ComfyUI Managed requires single-GPU accounting when multiple accelerators are visible.
    main_gpuCOMBO0 — Default GPU (backend device 0)Logical accelerator used as llama.cpp main_gpu. Names follow the GPU numbering visible to ComfyUI.
    tensor_splitSTRING
    vram_policyCOMBOAuto Yield to ComfyUI2 options: Auto Yield to ComfyUI, Keep Resident

    Outputs (1)

    NameTypeDescription
    settingsLOCAL_LLM_SETTINGS