Nodes/ComfyUI-Ollama-ImageList/Llama.cpp Generate (Multimodal)
ComfyUI Node

Llama.cpp Generate (Multimodal)

Loads one local GGUF model, analyzes optional image, audio, and video inputs in one llama-cpp-python chat request, then closes and releases the model immediately. No model cache is retained.

By craftingmod·Created 19 days ago·Updated 9 days ago· 2
Llama.cpp Generate (Multimodal)
  • sampling
  • runtime
  • ngram_speculative
  • images
  • audio
  • video
  • response
  • thinking
  • raw JSON
  • metrics
  • media diagnostics
model_path[no GGUF models found]
mmproj_path[none]
handlerauto
thinkingfalse
system
prompt
n_ctx8192
max_tokens512
gpu_layersall
temperature0.20
top_p0.95
top_k40
min_p0.05
repeat_penalty1.00
seed-1
stop
n_batch512
override_n_ubatchfalse
n_ubatch512
override_image_max_tokensfalse
image_max_tokens1120
main_gpu0
n_threads0
flash_attentionauto
use_mmaptrue
verbosefalse
reasoning_strengthauto
reasoning_budget0
override_image_min_tokensfalse
image_min_tokens1024
CategoryOllama/llama_cpp/legacy

Inputs (36)

NameTypeDefaultDescription
model_pathCOMBO[no GGUF models found]Main model GGUF from ComfyUI's registered LLM paths. The list is not filtered by filename; choose a compatible main model.
mmproj_pathCOMBO[none]Optional multimodal projector GGUF from the same unfiltered list. Choose [none] for text-only requests.
handlerCOMBOautoauto uses the model metadata and the fork's generic MTMD handler. Select a model-specific handler when its template requires one.
thinkingBOOLEANfalseExplicitly request thinking through the selected handler's template control. Gemma 4 uses enable_thinking and Qwen 3 VL uses force_reasoning. A checkpoint that does not support switching may ignore this value.
systemSTRINGOptional system message sent without trimming or rewriting.
promptSTRINGUser message sent without trimming or rewriting.
n_ctxINT8192512–1048576Context window in tokens, including media tokens and output.
max_tokensINT5121–131072Maximum number of generated tokens.
gpu_layersCOMBOallOffload all layers, let llama.cpp decide, or use CPU only.
temperatureFLOAT0.200–5
top_pFLOAT0.950–1
top_kINT400–10000
min_pFLOAT0.050–1
repeat_penaltyFLOAT1.000–5
seedINT-1-1–4294967295-1 uses llama.cpp's random seed behavior.
stopSTRINGOptional single stop string.
n_batchINT5121–65536Logical prompt batch size. When an image token limit is overridden, this must be at least the effective limit.
override_n_ubatchBOOLEANfalsePass n_ubatch explicitly. Leave disabled to use llama-cpp-python's default.
n_ubatchINT5121–65536Physical batch size used only when override_n_ubatch is enabled. Gemma 4 vision requires it to cover the selected image token chunk.
override_image_max_tokensBOOLEANfalsePass an explicit dynamic-resolution image token ceiling to the MTMD handler. Leave disabled to read the projector's default.
image_max_tokensINT11201–65536Per-image or per-video-frame token ceiling used only when its override is enabled. n_batch and effective n_ubatch must be at least this value.
main_gpuINT00–31
n_threadsINT00–10240 lets llama-cpp-python choose the CPU thread count.
flash_attentionCOMBOauto3 options: auto, enabled, disabled
use_mmapBOOLEANtrueMemory-map the GGUF while loaded; the mapping is closed after the response.
verboseBOOLEANfalsePrint llama.cpp model, timing, and multimodal chat-handler diagnostics to the ComfyUI console.
reasoning_strengthCOMBOautoOptional reasoning effort hint for templates such as Muse-Glimmer. auto omits the hint so the model template uses its own default. Ignored when thinking is disabled.
reasoning_budgetINT00–65536Maximum reasoning tokens for supported Qwen/Gemma reasoning formats. 0 applies no budget. Ignored when thinking is disabled.
override_image_min_tokensBOOLEANfalsePass an explicit dynamic-resolution image token floor to the MTMD handler. Qwen-VL grounding tasks may require 1024 or more.
image_min_tokensINT10241–65536Per-image or per-video-frame token floor used only when its override is enabled. n_batch and effective n_ubatch must cover this value.
samplingoptOLLAMA_IMAGE_LIST_LLAMA_CPP_SAMPLINGOptional output from Llama.cpp Sampling Preset. When connected, it overrides temperature, top_p, top_k, min_p, and repeat_penalty.
runtimeoptOLLAMA_IMAGE_LIST_LLAMA_CPP_GEMMA4_RUNTIMEOptional output from Llama.cpp Gemma 4 Runtime Preset. When connected, it overrides the Advanced n_batch, n_ubatch, image_max_tokens, and both override switches. Connect the preset's separate n_ctx and max_tokens outputs to apply those visible values.
ngram_speculativeoptOLLAMA_IMAGE_LIST_LLAMA_CPP_NGRAM_SPECULATIVEOptional output from Llama.cpp N-gram Speculative Preset. This model-free mode uses repeated context patterns and no draft GGUF. It is separate from Experimental native DFlash/DSpark decoding.
imagesoptIMAGEIMAGE single, batch, list, nested list, or ComfyUI data list.
audiooptAUDIOOptional ComfyUI AUDIO single, batch, list, or nested list. Audio is encoded as lossless PCM16 WAV and requires an audio-capable mmproj.
videooptVIDEOOptional ComfyUI VIDEO input. The original encoded stream is passed to llama.cpp's native libmtmd video helper and requires a wheel built with MTMD_VIDEO support plus a compatible mmproj. Embedded audio is not ingested; connect AUDIO separately.

Outputs (5)

NameTypeDescription
responseSTRING
thinkingSTRING
raw JSONSTRING
metricsSTRING
media diagnosticsOLLAMA_IMAGE_LIST_LLAMA_CPP_MEDIA_DIAGNOSTICS