Llama.cpp Generate
Model, hardware and reasoning decisions behind typed sockets
- model_profile
- hardware_profile
- reasoning
- speculative
- images
- audio
- video
- response
- thinking
- raw JSON
- metrics
- media diagnostics
"Llama.cpp Generate" is the everyday workhorse of this pack's llama.cpp half, and its design philosophy is right there in the category: compact. Where the legacy detailed node drowns you in thirty-plus advanced widgets, this one keeps only the things you actually change per request visible - model, prompts, context, token budget, media - and pushes the stable tuning knobs behind typed sockets you connect or don't. It runs one multimodal llama.cpp completion per execution, same stateless GGUF-in-process model as its detailed sibling, without the clutter.
The required inputs mirror the detailed node: model_path and mmproj_path from ComfyUI's LLM model folders (the projector is mandatory whenever you connect images, audio, or video), system and prompt, n_ctx (8192 default), max_tokens, seed, and stop. The one required socket is model_profile, which must come from the pack's Llama.cpp Model Profile node - that's how it gets its handler and sampling defaults, and it's non-negotiable, so the wiring is always explicit. Two visible request budgets are worth understanding: image_max_tokens and image_min_tokens, both defaulting to 0. A 0 means "leave the projector/handler default alone"; a positive value is an explicit override. The tooltip on image_min_tokens is the practical one - Qwen-VL grounding tasks often need 1024.
The optional sockets are where the flexibility lives:
hardware_profile- from Llama.cpp Hardware Runtime Profile. Disconnected means GPU Full Offload (all layers, n_batch 512, main GPU 0, auto threads/flash attention, mmap on).reasoning- from Llama.cpp Thinking / Reasoning Config. Disconnected means the model's default reasoning behavior.speculative- from either the Compact N-gram or the Experimental Native Speculative Config node. They share one socket; plug in one, not both.
The images, audio, and video inputs accept single items, batches, lists, or nested lists and flatten deterministically into a single completion - the same one-call list semantics as the Ollama node. Media order is always images, then audio, then video, and scalar inputs like prompts must resolve to exactly one value.
Outputs are response, thinking, raw JSON, metrics, and media diagnostics - the last being a typed receipt you can hand to the Media Diagnostics node if you want capability flags and counts without squinting at JSON.
Setup is shared with the whole pack:
cd ComfyUI/custom_nodes
git clone https://github.com/craftingmod/ComfyUI-Ollama-ImageList
...restart ComfyUI, and make sure the JamePeng llama-cpp-python fork wheel is installed in ComfyUI's Python environment (see the detailed node's page for the install saga - the compact node has the same dependency). It also needs ComfyUI 0.19.3+ for the V3 API.
My honest take: if you're going to use llama.cpp in this pack at all, use this node, not the legacy one. Profiles give you per-model presets you can reuse across workflows, and when something misbehaves you have three typed inputs to suspect instead of thirty widgets to scroll. The learning curve is "make a Model Profile, connect it, done" - everything else is optional by design.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| model_path | COMBO | [no GGUF models found] | 1 options: [no GGUF models found] |
| mmproj_path | COMBO | [none] | 1 options: [none] |
| model_profile | OLLAMA_IMAGE_LIST_LLAMA_CPP_MODEL_PROFILE | Required output from Llama.cpp Model Profile. | |
| system | STRING | — | |
| prompt | STRING | — | |
| n_ctx | INT | 8192512–1048576 | — |
| max_tokens | INT | 5121–131072 | — |
| image_max_tokens | INT | 00–65536 | 0 uses the mmproj/handler default. A positive value overrides the per-image or per-video-frame token ceiling. |
| seed | INT | -1-1–4294967295 | — |
| stop | STRING | — | |
| video_with_audio | BOOLEAN | false | When enabled, extract the first embedded video audio track with PyAV and pass it through the AUDIO input path. |
| verbose | BOOLEAN | false | — |
| image_min_tokens | INT | 00–65536 | 0 keeps the projector default. Qwen-VL grounding tasks may require 1024. |
| hardware_profileopt | OLLAMA_IMAGE_LIST_LLAMA_CPP_HARDWARE_RUNTIME_PROFILE | Optional output from Llama.cpp Hardware Runtime Profile. Disconnected uses GPU Full Offload. | |
| reasoningopt | OLLAMA_IMAGE_LIST_LLAMA_CPP_REASONING_CONFIG | Optional output from Llama.cpp Thinking / Reasoning Config. Disconnected uses model-default reasoning behavior. | |
| speculativeopt | OLLAMA_IMAGE_LIST_LLAMA_CPP_SPECULATIVE_CONFIG | Optional shared output from a Compact N-gram or Native Speculative Config node. | |
| imagesopt | IMAGE | — | |
| audioopt | AUDIO | Standalone AUDIO items. Audio belonging to VIDEO stays in VIDEO. | |
| videoopt | VIDEO | VIDEO items may contain their own AUDIO components. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |
| thinking | STRING | — |
| raw JSON | STRING | — |
| metrics | STRING | — |
| media diagnostics | OLLAMA_IMAGE_LIST_LLAMA_CPP_MEDIA_DIAGNOSTICS | — |