Llama.cpp Sequential Generate
The sequential variant for batches
- model_profile
- hardware_profile
- reasoning
- speculative
- images
- audio
- video
- response
- response sequence
- thinking
- raw JSON
- metrics
- media diagnostics
Here's the difference between this node and the compact Llama.cpp Generate, and it's a big one if you're captioning a batch: Sequential Generate loads the model once, runs every independent item in your input list one after another, resets context before each one, and only unloads when the whole sequence is done. The compact Generate sends everything in one request and the model never sees your items independently; this node treats each item as its own conversation. Same GGUF, same projectors, same outputs - but the outputs here are lists, one entry per input item.
Why would you want that? Think LoRA dataset captioning or batch image description. You've got a folder of reference images and a vision model (Qwen-VL, Gemma 4, whatever GGUF you have with a matching mmproj). With Sequential Generate you feed the whole list in one go, and each image gets its own clean prompt-and-response pair - no cross-contamination where the model answers "the second image is a dog" when you asked it to describe image one. The context is reset before every item, so answers don't drift. And because the model loads once instead of per image, a 50-image batch costs one model load instead of fifty.
The inputs are almost identical to the compact Generate: model_path and mmproj_path from the LLM model folders, a required model_profile socket from the Model Profile node, system and prompt, n_ctx, max_tokens, image_max_tokens / image_min_tokens (0 = projector default), seed, stop, verbose. Optional sockets for hardware_profile and reasoning behave the same as its sibling.
The one deliberate exclusion is speculative - the speculative socket is rejected on this node. The docs say why: the decoder history for speculative decoding can't yet be guaranteed independent between resets, so it's disabled here rather than risk state leaking between items. If you're wondering whether n-gram speculative would speed up your batch captioning run - it won't, because this node refuses the socket by design.
All five outputs - response, thinking, raw JSON, metrics, and media diagnostics - are is_list: true, so you get a parallel list you can index or zip with your source images. That's the shape you actually want when the goal is "one caption per image, in order."
Install is the pack standard, no surprises:
cd ComfyUI/custom_nodes
git clone https://github.com/craftingmod/ComfyUI-Ollama-ImageList
Then restart ComfyUI. Same two dependencies as the rest of the llama.cpp half: a JamePeng multimodal llama-cpp-python wheel in ComfyUI's Python environment, and ComfyUI 0.19.3+ for the V3 API.
The mental model that makes this node click: the normal compact Generate is a single conversation with a multi-image message; Sequential Generate is a loop of independent conversations, each with (typically) one image, sharing a single model load. If your task is "describe each of these separately," the latter is the one you want - and the single-load behavior is the kind of efficiency that makes a 100-image captioning job finish while you're still making coffee. Just remember it's still one completion per item, so budget your max_tokens and your patience accordingly.
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 (6)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |
| response sequence | LLAMA_SEQUENTIAL_RESPONSE | — |
| thinking | STRING | — |
| raw JSON | STRING | — |
| metrics | STRING | — |
| media diagnostics | OLLAMA_IMAGE_LIST_LLAMA_CPP_MEDIA_DIAGNOSTICS | — |