CLIPtion Beam Search
The Deterministic Twin When You Want the Same Caption Every Time
- model
- image
- STRING
CLIPtion Beam Search is CLIPtion Generate's less-charismatic sibling. Same pack, same tiny captioning model, same CLIP-it's-already-loaded trick - but swap the dice for a ruler. Feed it the same image, same model, same settings, and it writes the same caption every single time. There's no seed input at all, because there's no randomness to seed. If you're building a captioning pipeline where reproducibility matters - auto-tagging a dataset, diffing captions between runs, or just auditing what got written - this is the one you reach for.
How it works: the image goes through the CLIP vision encoder, and then instead of sampling tokens randomly the node runs a beam search over the same tiny decoder. At each step it keeps beam_width alternative partial captions alive in parallel, scores the candidates, prunes to the best few, and continues - finally picking the highest-scoring complete caption by CLIP similarity to the image. That's why the README calls it "less creative" than Generate: it's a deterministic search, not a roll of the dice, so it trends toward the safe, obvious caption rather than the occasionally inspired one.
The inputs that matter:
beam_width- the only real dial, default 4, up to 64. Higher means more candidates explored at each step, which usually means a better caption but more compute. Start at the default and nudge up only if captions feel undercooked.ramble- same as Generate's: force the decoder to write the full 77 tokens instead of stopping at its end-of-sentence token.
Required alongside those are model (the CLIPTION object from CLIPtionLoader) and image (a single image or batch). Output is a STRING list, one caption per input image - wire it into a Show Text / preview node or directly into a prompt encode downstream.
Two honest caveats before you switch everything over. Deterministic doesn't mean more accurate - beam search can get fixated on a repetitive phrase that a temperature sample would have dodged, and CLIPtion's ceiling is what it is: fast and decent on simple concepts, clearly short of a Florence or JoyCaption on hard content, and it flubs NSFW entirely. And "deterministic" is relative to the exact model weights and vision encoder you feed it - change the CLIP vision model or update the CLIPtion weights and results shift. Keep it when you need stability, keep Generate when you want variety, and honestly, running both side by side and picking the better caption is a legitimate workflow.
Install is identical to the rest of the pack - ComfyUI Manager, search "cliption", install, restart, or clone https://github.com/pharmapsychotic/comfy-cliption.git into ComfyUI/custom_nodes, pip install -r comfy-cliption/requirements.txt, and restart. Same light dependencies (huggingface-hub, safetensors, transformers), same CLIP vision requirement (openai/clip-vit-large-patch14, via Manager > Model Manager > "clip vision large"). The one setup trap applies here too: if the loader errors with "Must use model which includes CLIP-L", your checkpoint lacks the CLIP-L text encoder - swap to any standard SD-family model and it clears up.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model | CLIPTION | The CLIPtion model. | |
| image | IMAGE | — | |
| beam_width | INT | 41–64 | Number of beams to maintain during search. |
| rambleopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |