Nodes/Comfyui_image2prompt/Image to Text with Tags 🐼
ComfyUI Node

Image to Text with Tags 🐼

Image to Text with Tags 🐼 — ComfyUI Node Guide

By zhongpei·Created 3 years ago·Updated about a year ago· 386
Image to Text with Tags 🐼
  • model
  • image
  • FULL PROMPT
  • PROMPT
  • TAGS
queryWhat is this?
custom_query
print_logfalse
scorefalse
remove_1girltrue

What it is

This is Image2Text's more opinionated sibling. Where the plain node gives you one caption from one model, Image2TextWithTags is built specifically around the pack author's own recommendation: pair a natural-language captioner (moondream1 or moondream2) with a Danbooru-style tagger (wd-swinv2-tagger-v3) and get both a description and a tag list out of a single node, plus a merged version of the two.

The README is explicit about why this split exists. moondream1 writes richer scene descriptions but can ramble; moondream2 is tighter and more accurate, especially on people. wd-swinv2-tagger-v3 is the WD (Waifu Diffusion) SwinV2 tagger - the same family as the well-known WD14 tagger used for anime LoRA training data - and it's genuinely good at pulling out precise Danbooru-style character and clothing tags that a captioning model tends to gloss over. So the node's own advice: for scene-heavy images, run moondream1 + the tagger; for character-heavy images, moondream2 + the tagger.

How it works

You still wire in a single IMAGE2TEXT_MODEL from the Loader node - that's your captioning half, the moondream/deepseek/whatever model doing the natural-language description. Alongside that, the node produces a separate Danbooru-style tag list for the same image and gives you all three views: the raw description, the raw tags, and a combined version. This is essentially the README's recommended two-model workflow baked into one node instead of two you'd have to wire together yourself.

Inputs and outputs

Same core inputs as Image2Text - model, image, query (four presets, including that long "AI image tagging expert" instruction), custom_query, print_log - plus two this node adds:

  • score - off by default.
  • remove_1girl - on by default. Danbooru taggers slap 1girl on nearly every anime-style portrait; it's true so often it carries almost no information, so this strips it out of the tag output automatically. If you're specifically training or prompting for gender/count and want that tag preserved, turn it off.

Three outputs, all list-typed:

  • FULL PROMPT - description and tags merged.
  • PROMPT - the natural-language caption alone.
  • TAGS - the Danbooru-style tag list alone.

Wire whichever one matches what you're feeding downstream - TAGS if your target checkpoint is Illustrious/NoobAI/Pony-lineage and wants comma-separated tags, PROMPT if you're writing to a natural-language encoder, FULL PROMPT if you want both and are willing to let the target model sort it out.

Installing it

Same pack, same steps as every node here:

cd ComfyUI/custom_nodes
git clone https://github.com/zhongpei/Comfyui_image2prompt

Or search "Comfyui_image2prompt" in ComfyUI Manager. Models auto-download on first use into ComfyUI/models/image2text/; if that fails silently, pull them by hand with huggingface-cli download as the README documents (mirror endpoint available for users behind the Great Firewall).

Common issues

Choosing the wrong captioning half. The whole point of this node only pays off if you pick moondream1 vs. moondream2 deliberately based on whether the image is scene-heavy or character-heavy - defaulting to whichever loads first and not thinking about it gives you mediocre results from both halves.

Know which paradigm your target model actually wants before you pick an output. TAGS is Danbooru vocabulary - it's the right call for anything in the Illustrious/NoobAI/Pony lineage, where exact tags reliably beat sentences for pose, clothing, and camera control. PROMPT is closer to what a natural-language-trained checkpoint wants. Piping TAGS into a natural-language model, or a long PROMPT sentence into a tag-based one, quietly degrades results rather than erroring - there's no warning either way.

Same dependency and download weight as Image2Text. You're now loading two model families for one node call instead of one, so first-run downloads and VRAM pressure are correspondingly higher. If you're tight on VRAM, low_memory on the Loader node is worth turning on before you reach for a smaller model.

Categoryfofo🐼/image2prompt

Inputs (7)

NameTypeDefaultDescription
modelIMAGE2TEXT_MODEL
imageIMAGE
queryCOMBOWhat is this?4 options: Describe this photograph., What is this?, Please describe this image in detail., As an AI image tagging expert, please provide precise tags for these images to enhance CLIP model's understanding of the content. Employ succinct keywords or phrases, steering clear of elaborate sentences and extraneous conjunctions. Prioritize the tags by relevance. Your tags should capture key elements such as the main subject, setting, artistic style, composition, image quality, color tone, filter, and camera specifications, and any other tags crucial for the image. When tagging photos of people, include specific details like gender, nationality, attire, actions, pose, expressions, accessories, makeup, composition type, age, etc. For other image categories, apply appropriate and common descriptive tags as well. Recognize and tag any celebrities, well-known landmark or IPs if clearly featured in the image. Your tags should be accurate, non-duplicative, and within a 20-75 word count range.
custom_querySTRING
print_logBOOLEANfalse
scoreBOOLEANfalse
remove_1girlBOOLEANtrue

Outputs (3)

NameTypeDescription
FULL PROMPTSTRING
PROMPTSTRING
TAGSSTRING