Nodes/ComfyUI-WepeNerd/Image Captioner (Advanced)
ComfyUI Node

Image Captioner (Advanced)

Styles, cleanup rules, and batch output

By WepeNerd·Created 5 months ago·Updated about 17 hours ago· 0
Image Captioner (Advanced)
  • config
  • image
  • caption
instructionDescribe this image accurately and in detail.
max_tokens512
temperature0.20
seed0
caption_style
reasoning_effortnone
system_prompt_override
caption_prefix
banned_phrases
image_max_edge1024
jpeg_quality90

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 with system_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.

CategoryWepeNerd/Local AI/Advanced

Inputs (13)

NameTypeDefaultDescription
configGGUF_LLM_CONFIG
imageIMAGE
instructionSTRINGDescribe this image accurately and in detail.
max_tokensINT5121–4096
temperatureFLOAT0.200–2
seedINT00–18446744073709550000
caption_styleCOMBO6 options: dataset_natural, detailed_visual, short, booru_tags, motion_camera, custom
reasoning_effortCOMBOnone5 options: default, none, low, medium, high
system_prompt_overrideoptSTRING
caption_prefixoptSTRING
banned_phrasesoptSTRING
image_max_edgeoptINT102464–4096
jpeg_qualityoptINT901–100

Outputs (1)

NameTypeDescription
captionSTRING