Nodes/Ollama-ImageList/Llama.cpp Sequential Generate
ComfyUI Node

Llama.cpp Sequential Generate

The sequential variant for batches

By craftingmod·Created about a month ago·Updated 11 days ago· 2
Llama.cpp Sequential Generate
  • model_profile
  • hardware_profile
  • reasoning
  • speculative
  • images
  • audio
  • video
  • response
  • response sequence
  • thinking
  • raw JSON
  • metrics
  • media diagnostics
model_path[no GGUF models found]
mmproj_path[none]
system
prompt
n_ctx8192
max_tokens512
image_max_tokens0
seed-1
stop
video_with_audiofalse
verbosefalse
image_min_tokens0

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.

CategoryOllama/llama_cpp/compact

Inputs (19)

NameTypeDefaultDescription
model_pathCOMBO[no GGUF models found]1 options: [no GGUF models found]
mmproj_pathCOMBO[none]1 options: [none]
model_profileOLLAMA_IMAGE_LIST_LLAMA_CPP_MODEL_PROFILERequired output from Llama.cpp Model Profile.
systemSTRING
promptSTRING
n_ctxINT8192512–1048576
max_tokensINT5121–131072
image_max_tokensINT00–655360 uses the mmproj/handler default. A positive value overrides the per-image or per-video-frame token ceiling.
seedINT-1-1–4294967295
stopSTRING
video_with_audioBOOLEANfalseWhen enabled, extract the first embedded video audio track with PyAV and pass it through the AUDIO input path.
verboseBOOLEANfalse
image_min_tokensINT00–655360 keeps the projector default. Qwen-VL grounding tasks may require 1024.
hardware_profileoptOLLAMA_IMAGE_LIST_LLAMA_CPP_HARDWARE_RUNTIME_PROFILEOptional output from Llama.cpp Hardware Runtime Profile. Disconnected uses GPU Full Offload.
reasoningoptOLLAMA_IMAGE_LIST_LLAMA_CPP_REASONING_CONFIGOptional output from Llama.cpp Thinking / Reasoning Config. Disconnected uses model-default reasoning behavior.
speculativeoptOLLAMA_IMAGE_LIST_LLAMA_CPP_SPECULATIVE_CONFIGOptional shared output from a Compact N-gram or Native Speculative Config node.
imagesoptIMAGE
audiooptAUDIOStandalone AUDIO items. Audio belonging to VIDEO stays in VIDEO.
videooptVIDEOVIDEO items may contain their own AUDIO components.

Outputs (6)

NameTypeDescription
responseSTRING
response sequenceLLAMA_SEQUENTIAL_RESPONSE
thinkingSTRING
raw JSONSTRING
metricsSTRING
media diagnosticsOLLAMA_IMAGE_LIST_LLAMA_CPP_MEDIA_DIAGNOSTICS