Nodes/ComfyUI LC Vision Nodes/LC Vision Danbooru Caption 🏷️
ComfyUI Node

LC Vision Danbooru Caption 🏷️

An auto-tagger that actually checks its tags

By lonecatone23Β·Created 2 months agoΒ·Updated about 17 hours agoΒ· 16
LC Vision Danbooru Caption 🏷️
  • vision_model
  • image
  • positive
  • negative
β—„modeImage analysisβ–Ί
β—„outputDanbooru tagsβ–Ί
β—„promptβ–Ί
β—„negativeβ–Ί
β—„style_tagNoneβ–Ί
β—„quality_tagsnoneβ–Ί
β—„max_tokens150β–Ί
β—„temperature0.30β–Ί
β—„seed0β–Ί

Every auto-tagger has the same failure: it hands you denim jeans and smiling, neither a real Danbooru tag, so your Illustrious model quietly ignores both. LC Vision Danbooru Caption is a Qwen3-VL node that writes SDXL-family prompts - short caption, detailed caption, tags, or tags plus a sentence - and checks every tag against the real tag list before it reaches your text encoder. Made-up tags get deleted instead of padding your prompt.

Where it sits in the workflow

Danbooru tags aren't descriptions, they're a controlled vocabulary, and the anime SDXL lineage - Illustrious, NoobAI, Pony - was trained on exactly that vocabulary. A correct tag beats a sentence for pose, clothing, camera and identity (danbooru-tags).

Reach for this to reverse-engineer a prompt from a reference image, seed an img2img pass, sharpen a three-word idea, or caption an anime LoRA set. The mainstream tool for that last job is still a WD14-style tagger - half a gigabyte, instant, built for precisely this. This node is what you pick when you want a sentence plus tags (prompt gen mixed), or scene detail a tagger's fixed head can't express. On a small personal set it's a draft, not the final answer.

How it works

In Image analysis the image goes in as base64 JPEG, downscaled to 768px on the long side, and only the first frame of a batch is used. Prompt enhance ignores the image and rewrites whatever's in prompt. On Qwen3-family models the node prepends /no_think, so you don't get planning text in the answer.

The tag path is two passes, not one. It asks for a 200-token detailed caption first, then asks for tags from that description plus anything the description missed - which is why the list comes out fuller than a single-shot ask.

Then the repair pass. danbooru_tags.csv (SmilingWolf's WD tagger list, Apache-2.0, ships in the repo) is loaded as a set and every candidate is validated: underscores become spaces, plurals and -ing forms get repaired, synonyms map over (denim jeans β†’ jeans, smiling β†’ smile), and a phrase is split into the real tags inside it - sitting on fence becomes sitting + fence. Vague real tags like nature get dropped. If the CSV is missing, the console says so and tags pass through unchecked.

It also fixes what models get logically wrong: no humans next to 1girl is cleaned out, a dressed-up animal becomes no humans, animal focus, only one framing tag survives, and bare parentheses get escaped so ComfyUI doesn't read them as attention weights.

Inputs worth setting

  • mode - Image analysis reads the picture; Prompt enhance rewrites the prompt box, which Image analysis ignores. No image in the first mode, or an empty prompt in the second, raises rather than guessing.
  • output - Danbooru tags is the default and the one for Pony/Illustrious. The two captions suit realism finetunes; prompt gen mixed gives one or two sentences then the tags.
  • quality_tags - none by default, and the author says why: they sometimes do more harm than good. On, you get masterpiece, best quality... (Illustrious), very awa, masterpiece... (NoobAI) or score_9, score_8_up, score_7_up (Pony) up front, and the opposite in the negative. Match your checkpoint - score tags are inert on Illustrious (score-tags).
  • style_tag - tag outputs only. Real style tags get injected after the subject count: Anime adds anime coloring, anime screencap.
  • max_tokens - the instructions follow it: 80 for a short caption, 150 for detailed or tags, 200 for mixed. Leave temperature at 0.3; tags want it low.

Two outputs, both strings: positive and negative. The negative always carries the anatomy, artifact and censorship list (bad anatomy, malformed hands, fused fingers, watermark, censored, ...); whatever you typed in negative goes first, duplicates removed. Wire both into your CLIPTextEncode pair.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC_Vision_nodes.git
python install.py

install.py checks for a vision-capable llama_cpp and does nothing if you already have one. Otherwise it detects your Python, platform and CUDA version and installs the matching wheel from JamePeng/llama-cpp-python - the fork, because the vision chat handlers were never merged upstream and those wheels live on GitHub Releases, not PyPI. ComfyUI Manager does the same thing if you install the pack by name. Restart afterwards; the console should print the LC Vision load line with 4 nodes.

You still need a model, from the pack's LC Vision Loader: a Qwen3-VL GGUF plus its mmproj, dropped into models/LLM/GGUF or auto-downloaded by picking a Download: entry. One image and a short prompt only needs 4k context, and the Loader's β˜… hint picks down to 8B Q4_K_M before falling back to 4B, because 8B tags noticeably better.

Where people get burned

Turn the Loader's keep_model_loaded off for SDXL work. This node releases the model in a finally block, which is exactly what you want when a Pony or Illustrious checkpoint is fighting for the same card.

The prebuilt wheels are CUDA-only. On AMD, Intel or a machine with no NVIDIA runtime, install.py stops rather than install something that can't import; you build the fork yourself (Vulkan or HIP), or install the matching wheel by hand.

If two people are in the frame, expect attribution mistakes - VLMs mix up who's wearing what, and that weakness hasn't moved in years (llm-in-comfyui). A wrong tag is worse than a missing one, so read the output.

One console line is not a bug: [LC Vision] Decode failed on a reused model instance...; rebuilding and retrying once. This node recovers from the fork's reused-model decode bug on its own. Only worry if the retry fails too.

CategoryLC Vision

Inputs (11)

NameTypeDefaultDescription
vision_modelLC_VISION_MODELHandle from LC Vision Loader.
modeCOMBOImage analysisImage analysis: writes the prompt from the image. Prompt enhance: rewrites the idea written in prompt.
outputCOMBODanbooru tagsshort caption (80 tokens max), detailed caption (150), Danbooru tags (150), prompt gen mixed: tags plus a sentence (200). Each finetune likes a different one: Pony and Illustrious lean on tags, realism finetunes on captions.
promptSTRINGPrompt enhance: the rough idea to rewrite. Not used in Image analysis.
negativeSTRINGYour own negative prompt, used in both modes. It goes first in the negative output, followed by the automatic anatomy / artifact / censorship tags (duplicates removed).
style_tagCOMBONoneCommits the prompt to a visual style. 'None' leaves it as the image or idea is.
quality_tagsCOMBOnoneAdds the quality / score tags up front and their opposites to the negative. They sometimes do more harm than good: off by default.
max_tokensINT15016–1024How long the prompt can be, for every output. The instructions follow it (about max_tokens / 4 tags, captions about 0.7 words per token). Rough guide: short caption 80, detailed caption 150, tags 150, mixed 200.
temperatureFLOAT0.300–2Low = literal and repeatable. Tags want it low.
seedINT00–4294967295β€”
imageoptIMAGEThe picture to describe (Image analysis). The first frame of a batch is used.

Outputs (2)

NameTypeDescription
positiveSTRINGThe prompt for your SDXL / Pony / Illustrious text encoder.
negativeSTRINGA matching negative prompt (with the score / quality tags when quality_tags is on).