Nodes/GraftingRayman/GR BLIP 2 Caption Generator
ComfyUI Node

GR BLIP 2 Caption Generator

Quick image captions, but know what it's not for

By GraftingRayman·Created 2 years ago·Updated about a month ago· 76
GR BLIP 2 Caption Generator
  • image
  • caption
max_length50
num_beams5
temperature0.7
top_k50

This node does exactly what the name says - feed it an image, it hands back a caption string using Salesforce's BLIP-2. No task picker, no model dropdown, no fifteen-way menu: just five generation knobs and one output. If you want a quick, no-fuss description of an image dropped into your graph, that simplicity is the whole appeal.

Where you should temper expectations is dataset captioning for LoRA training. The wider ComfyUI/Stable Diffusion community has a genuinely blunt opinion of the BLIP lineage here: it's considered dated and formulaic next to what Florence-2 or JoyCaption produce, to the point where "don't be lazy, caption them by hand" is standard advice specifically aimed at people reaching for BLIP out of convenience. BLIP-2 is a newer, better model than the original BLIP that earned that reputation, and this node isn't captioning a training set - it's producing a one-off caption for whatever's in your graph right now, which is a different job. But if you're building this into a LoRA-training pipeline, it's worth knowing the community's default recommendation has moved on, and reaching for Florence-2 or manual captioning will get you further.

How it works

BLIP-2 pairs a frozen vision encoder with a lightweight bridge (the Q-Former) into a language model, so it's genuinely a vision-language model rather than a bolted-together classifier. This node runs that pipeline with standard beam-search text generation on top - the same mechanism you'd see on any transformer captioner, just with BLIP-2 as the backbone.

The inputs and outputs that matter

  • image - the required input, obviously.
  • max_length (default 50, up to 100) - cap on caption length. BLIP-2 captions tend to be short by nature; pushing this up doesn't reliably get you a longer, richer description, just headroom for one if the model wants it.
  • num_beams (default 5) and temperature (default 0.7) - beam search width and sampling randomness. Lower temperature for a more literal, repeatable caption; push it up if you want more varied phrasing across runs.
  • top_k (default 50) - nucleus-style sampling cutoff, works alongside temperature.

One output: caption, a plain string - wire it into a text node, a prompt input, or wherever you need a quick description.

How to install it

Via ComfyUI Manager, search GraftingRayman. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/GraftingRayman/ComfyUI_GraftingRayman

Restart afterward. The pack-wide gotcha applies here too: the README requires OpenAI's CLIP installed separately or the whole pack fails to import. Portable ComfyUI: .\python_embeded\python.exe -m pip install git+https://github.com/openai/CLIP.git. System Python: pip install git+https://github.com/openai/CLIP.git.

Common issues & troubleshooting

Nodes don't show up at all after install. Check for the missing-CLIP import error in your console on startup - this is the single most common reason this pack fails silently, and the fix is the pip command above.

First run downloads BLIP-2's weights. Expect a multi-gigabyte pull from HuggingFace the first time you run this node; it's not a small model.

Captions feel generic or repetitive. That's BLIP-2's known character next to newer captioners - it tends toward short, formulaic descriptions rather than rich detail. If you need something more descriptive for prompt-writing or training data, this isn't the tool the community currently recommends for that; Florence-2 is the more common pick for natural-language captions in this ecosystem.

Output reads oddly at low num_beams. Beam search with num_beams=1 is effectively greedy decoding and can produce blander, more clipped text. Bumping it to 5 (the default) or higher smooths that out at the cost of a bit more compute per caption.

CategoryGraftingRayman/Image Processing

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
max_lengthINT501–100
num_beamsINT51–10
temperatureFLOAT0.70.1–1
top_kINT501–100

Outputs (1)

NameTypeDescription
captionSTRING