Nodes/danbot-comfy-node/Danbot Generator
ComfyUI Node

Danbot Generator

Where a sentence becomes a tag list

By p1atdev·Created 2 years ago·Updated about a year ago· 35
Danbot Generator
  • danbot_model
  • generation_config
  • generated_tags
  • raw_output
text_prompt
tag_template
seed0
stop_token</general>
ban_tags

Danbot Generator is the workhorse of the pack - the node that actually runs the model. You feed it a natural-language prompt, it runs the Danbot transformer, and out comes a Danbooru-style tag list ready for an anime checkpoint like Illustrious, NoobAI, or AnimagineXL. If you've ever written a sentence in a prompt box and wished the model "just got it," this is the translation layer.

It calls itself an "upsampler" in the source, which is the right mental model: the Danbot model doesn't invent a prompt from nothing, it takes your sentence plus a tag template and emits tags in the exact vocabulary the anime models were trained on. That's the whole trick - Danbooru-trained models understand 1girl, solo, animal ears, school uniform far better than prose, so you get precision for free.

The inputs that matter

  • text_prompt - your sentence. English and Japanese are supported, which is genuinely rare and worth calling out; the model was trained to bridge both into the same English tag vocabulary.
  • tag_template - the formatted template string from the Danbot V2408 Formatter (or a Template Config node). This carries the rating/aspect/length control tokens that steer the output. Don't hand-type one; let the Formatter build it.
  • seed - set it for reproducible tag output, just like a sampler seed.
  • Optional generation_config - a Danbot Generation Config object. Skip it and you get greedy decoding (do_sample=false), which is fine for a first pass.
  • Optional ban_tags - comma-separated tags the model is told not to emit. Wire in Danbot Load Ban Tags here, or type a couple by hand.
  • Optional stop_token - the token that ends generation. Defaults to </general>, which is right for the standard extension template; you'll rarely touch it.

The outputs

Two strings, and the difference matters:

  • generated_tags - the cleaned tag list with special tokens stripped. This is the one you wire into a text encoder's positive prompt.
  • raw_output - the raw model text including the <copyright>, <character>, <translation> and <extension> markers. This is what the Extractor nodes read when you want to split tags into categories for a multi-stage prompt.

Where people get burned

The generator is only as good as the template feeding it. Wire it without a template - or with a mismatched one - and the model produces mush, because it's genuinely confused about what it's supposed to emit. Also: it needs the danbot_model handle from Danbot Load Model, not a filename, and the model has to have finished downloading before anything downstream will run. First-run "hang" is the download, not a dead node.

Install

ComfyUI Manager → search danbot-comfy-node, or:

cd ComfyUI/custom_nodes
git clone https://github.com/p1atdev/danbot-comfy-node
cd danbot-comfy-node
pip install -r requirements.txt

(portable: ../../../python_embeded/python.exe -s -m pip install -r requirements.txt). Requirements are transformers, sentencepiece, protobuf - nothing exotic. Restart, then wire Model → Generator → text encoder and let the model download on first run.

Categoryprompt/Danbooru Tags Translator

Inputs (7)

NameTypeDefaultDescription
danbot_modelDANBOT_MODEL
text_promptSTRINGNatural language prompt. English and Japanese are supported.
tag_templateSTRINGFormatted tag template that will be passed to the danbot model to upsample tags
seedINT00–4294967295
stop_tokenoptSTRING</general>Stop token to stop generation
ban_tagsoptSTRINGTags to ban during generation
generation_configoptDANBOT_GENERATION_CONFIGGeneration configuration for the upmsapling tags

Outputs (2)

NameTypeDescription
generated_tagsSTRING
raw_outputSTRING