Shrug VLM Batch
N prompts in one request instead of N slow round-trips
- connection
- images
- responses
- count
If you've ever chained a ShrugVLM node into a loop to caption twenty frames, you know the feeling: each iteration pays connection overhead, image encoding, and serial wait time for a model that's just sitting there between calls. Shrug VLM Batch fixes the obvious part - it sends N prompts (with optional N images) in a single request to the server's /v1/batch/chat/completions endpoint. The README claims 2-4x throughput over N sequential calls, and that tracks: one round trip, one batched generation pass.
Reach for it when the job is many-versions-of-the-same-thing: captioning a folder of frames, describing a sequence of reference images for a video workflow, generating a batch of style variants, or running the same evaluation across a bunch of prompts.
How it works
You type your prompts into a single multiline box, one per line. The node splits on newlines, drops empties, and builds one request per prompt. If you also feed it an IMAGE batch, it zips them - prompt i gets image i. Everything goes up in one POST, and the responses come back as a list. The batching is the point: the server can reuse prefix cache and avoid per-call overhead, which is where the 2-4x lives.
The inputs that matter
user_prompts- one prompt per line. Empty lines are ignored (the tooltip's exact words), so don't stress about trailing newlines.system_prompt- shared across all prompts in the batch.images(optional) - anIMAGEbatch. Note it's one image per prompt; if you have more images than prompts, the extras don't get used.max_tokens,temperature- same semantics as the singleShrugVLMnode.image_resize_max(default 512) - unlike the single node (default 0, meaning off), batch defaults to resizing the longest edge to 512 before upload. That's the sensible default for bulk captioning; bump it if your task actually needs detail.image_quality(default 85) - JPEG quality for uploads.
Two outputs: responses - a list of strings, one per prompt - and count, an int you can use as a sanity check that every prompt actually got an answer.
How to install
Same pack install as everything else. ComfyUI Manager, search Shrug-Prompter, install, restart:
cd ComfyUI/custom_nodes
git clone https://github.com/fblissjr/shrug-prompter
Dependencies are already present in modern ComfyUI (httpx, orjson, pillow, torch, numpy), and models live on the heylookitsanllm server, not in ComfyUI. You need a current ComfyUI (V3 extension API) and a ShrugConnection feeding this node.
Common issues
- The list output won't plug into your ShowText node.
responsesis a list of strings, not a single string. Plain ShowText-style nodes often choke on it. Grab a list-aware display node, or iterate with a loop node, and usecountto confirm you got all of them. - Responses misaligned with prompts. If you change the prompt list between runs, ComfyUI may reuse cached outputs. Bypass or change the text to force re-execution.
- Fewer responses than prompts. Partial-failure semantics on the batch endpoint are, per the author's own notes, undocumented. If
countdisagrees with your prompt count, check the server logs. - Images look wrong at batch scale. Remember the default
image_resize_maxof 512 - small uploads, so caption quality is fine but fine-detail questions will underperform. That's a setting, not a bug.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| connection | SHRUG_CONN | — | |
| user_prompts | STRING | One prompt per line. Empty lines are ignored. | |
| system_prompt | STRING | — | |
| max_tokens | INT | 10241–32000 | — |
| temperature | FLOAT | 0.700–2 | — |
| image_resize_max | INT | 5120–4096 | — |
| image_quality | INT | 8520–100 | — |
| imagesopt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| responses | STRING | — |
| count | INT | — |