Image Captioner (Advanced)
Styles, cleanup rules, and batch output
- config
- image
- caption
Image Captioner (Advanced) is the serious dataset tool of the Local AI stack. The simple Image Captioner gives you a style dropdown and an instruction box; this one adds per-output cleanup - caption_prefix, banned_phrases - plus control over encoding (image_max_edge, jpeg_quality) and sampling (temperature, seed, reasoning_effort). If you're auto-captioning a real LoRA training folder, this is the node you want, because caption consistency across thousands of images is exactly where a raw VLM output falls down.
The caption_style dropdown is the heart of it:
dataset_natural- one accurate natural-language caption for training sets on LLM-encoded bases. "Do not invent facts" is in the instruction itself, which is the right bias for captions that will train a model.detailed_visual- richer description for img2img seeding or when you want more signal per image.short- bare factual caption, name the subject/action/setting.booru_tags- comma-separated tags for the Danbooru-trained lineage (Illustrious, Pony, NoobAI).motion_camera- visible motion cues, camera viewpoint and framing. This is the one for pulling stills into image-to-video work.custom- pairs withsystem_prompt_override; the node refuses "custom" without an override.
The cleanup layer is the differentiator. banned_phrases (one per line) strips unwanted strings from every caption - useful when your model keeps adding a watermark phrase or a euphemism you don't want in the training data. caption_prefix prepends a fixed string ("masterpiece, " or a style tag), with comma joining when the style is booru tags. The cleaner also strips chat preamble ("Sure, here is the caption:") and collapses stray whitespace, so the output is caption-shaped, not chat-shaped - the exact failure mode the KB flags for this whole node category.
Mechanically: the config input comes from Local AI Model (Advanced) and must have an mmproj projector selected - the node errors otherwise, and the projector must match the model (mismatch is the most common "image request rejected" cause, next to an outdated llama.cpp build). Images are downscaled to image_max_edge (1024 default) without upscaling, JPEG-encoded at jpeg_quality 90, and sent as data URLs through one server acquisition. The caption output is a list - one caption per image in the batch, in order. Feed it Load Image Batch and you get a caption list ready to zip with filenames.
Reality check from the KB: every VLM in this category, including much bigger models, blurs multi-subject attribution - two people, and "who wears what" gets scrambled. Auto-caption the volume, hand-fix the important set. And reasoning_effort defaults to none because a captioner should describe, not deliberate; if you raise it, watch for the extra token cost with little caption-quality gain.
Install with the pack: ComfyUI Manager, search WepeNerd, or git clone https://github.com/WepeNerd/ComfyUI-WepeNerd.git into custom_nodes, then pip install -r requirements.txt and restart. llama-server on PATH and the model in ComfyUI/models/LLM remain the non-negotiable prerequisites.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| config | GGUF_LLM_CONFIG | — | |
| image | IMAGE | — | |
| instruction | STRING | Describe this image accurately and in detail. | — |
| max_tokens | INT | 5121–4096 | — |
| temperature | FLOAT | 0.200–2 | — |
| seed | INT | 00–18446744073709550000 | — |
| caption_style | COMBO | 6 options: dataset_natural, detailed_visual, short, booru_tags, motion_camera, custom | |
| reasoning_effort | COMBO | none | 5 options: default, none, low, medium, high |
| system_prompt_overrideopt | STRING | — | |
| caption_prefixopt | STRING | — | |
| banned_phrasesopt | STRING | — | |
| image_max_edgeopt | INT | 102464–4096 | — |
| jpeg_qualityopt | INT | 901–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| caption | STRING | — |