Danbot V2408 Formatter
The node that builds the model's actual prompt string
- model
- template_config
- format_kwargs
- tag_template
The Danbot model doesn't read your sentence directly and wing it. It expects a specific prompt shape - a chat-like scaffold with rating, aspect-ratio, and length tokens up front, then marker slots for copyright, character, translation, and extension tags. Danbot V2408 Formatter is the node that assembles that scaffold. It's the plumbing between the config dials and the Generator, and honestly, it's the one you most want to understand if you ever want to peek under the hood.
Why does the scaffold exist at all? Because the model is an encoder-decoder trained to fill in these slots. Hand it a template with the right tokens and it knows exactly what job it's doing - "translate this sentence" vs "extend this tag list." Skip the template and the Generator produces garbage, because the model genuinely doesn't know what to emit.
The inputs
Three required:
model- thedanbot_modelhandle from Danbot Load Model. The formatter needs it because the prompt templates live inside the model wrapper, loaded from the pack'sconfig/prompt_templates.yml.template_config- a V2408 Template Config handle carrying the rating/aspect/length dials.template_name-translationorextension, usually wired from the Template Config node's second output. Selects which template to build.
One optional: format_kwargs (type DANBOT_FORMAT_KWARGS) - this is where the Translation Extractor and Extension Extractor plug in. In a two-pass graph, the translation extractor's copyright/character/translation keys get splashed into the extension template so the second pass has context to extend from.
The output
A single string: tag_template. That's what you feed into the Danbot Generator's tag_template input. It looks like gibberish - <|bos|>, <|rating:general|>, <|aspect_ratio:tall|>, <|translate:exact|>, <copyright>... - but every token is load-bearing. The Generator passes it verbatim to the model.
Practical notes
- In the bundled V2408 Pipeline this formatting is internal; you only build the Formatter graph by hand when you want fine control (e.g. a different config per pass, or extractor kwargs you've edited).
- The v2408 half of the pack's README example uses
translation+very_shortfor pass one andextension+longfor pass two. Copy that split; it's the tuned recipe. EXPERIMENTALflag in source - the node is just string formatting, and it's stable enough that the pack's own shipped workflows depend on it.
Install
ComfyUI Manager → 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.) Restart ComfyUI; dependencies are transformers, sentencepiece, protobuf.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model | DANBOT_MODEL | — | |
| template_config | DANBOT_TEMPLATE_CONFIG | — | |
| template_name | COMBO | 2 options: translation, extension | |
| format_kwargsopt | DANBOT_FORMAT_KWARGS | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| tag_template | STRING | Formatted tag template that should be passed to the upsampler node. |