Nodes/danbot-comfy-node/Danbot V2408 Template Config
ComfyUI Node

Danbot V2408 Template Config

The rating, length, and aspect dials for the tag model

By p1atdev·Created 2 years ago·Updated about a year ago· 35
Danbot V2408 Template Config
    • template_config
    • template_name
    aspect_ratiotall
    ratinggeneral
    lengthvery_short
    template_nametranslation

    The v2408 Danbot model is picky about context: before it translates anything, it wants to know the rating, the aspect ratio, and the length of the tag list you're after. Danbot V2408 Template Config is where you set those three dials. It produces the config object that the V2408 Formatter uses to build the model's prompt - so this node is the "what kind of output do you want" control for the whole v2408 half of the pack.

    Like the other v2408 nodes it's marked EXPERIMENTAL, but it's really just a struct builder - four dropdowns, no math, nothing fragile.

    The inputs

    Four required dropdowns:

    • rating - auto, general, sensitive, questionable, explicit. This maps to a <|rating:...|> token and steers the content rating of the tags the model emits. Given the pack's Danbooru lineage, this axis is doing real work - pick deliberately. (Keep reading; auto has a trap, below.)
    • aspect_ratio - the seven buckets from the Auto Aspect Ratio Tag node (square, tall, wide, plus the wallpaper and extreme edges). Default tall. Wire the Auto node's output here to keep it synced to your canvas.
    • length - very_short, short, long, very_long. How many tags the model should aim for. The README's own recipe uses very_short for translation and long for extension - a sensible split: translate the gist first, then pad it out.
    • template_name - translation or extension, i.e. which of the two prompt templates this config is driving. You'll typically use two of these nodes, one per pass.

    The outputs

    Two handles: template_config (type DANBOT_TEMPLATE_CONFIG), which carries the three dials, and template_name, a string passthrough of the dropdown. Both feed the V2408 Formatter - the config for token mapping, the name to pick the template. In the one-node V2408 Pipeline you can also pass template configs straight into the translation_template_config and extension_template_config inputs and skip the Formatter entirely.

    A beginner's trap

    Don't trust the auto rating. The dropdown lists it first, which makes it look like the safe default - but the node maps the rating straight into a token table that has no auto entry, so selecting it throws a KeyError and the node dies mid-graph. There's a rating-sniffing helper in the pack's library that could back it, but it's never wired into the node path. Set general and move on unless you deliberately want the sensitive/questionable/explicit vocabulary surfaced.

    Install

    Pack-standard 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, and it's under prompt/Danbooru Tags Translator.

    Categoryprompt/Danbooru Tags Translator

    Inputs (4)

    NameTypeDefaultDescription
    aspect_ratioCOMBOtall7 options: too_tall, tall_wallpaper, tall, square, wide, wide_wallpaper, +1
    ratingCOMBOgeneral5 options: auto, general, sensitive, questionable, explicit
    lengthCOMBOvery_short4 options: very_short, short, long, very_long
    template_nameCOMBOtranslation2 options: translation, extension

    Outputs (2)

    NameTypeDescription
    template_configDANBOT_TEMPLATE_CONFIGThe template config.
    template_nametranslation,extensionThe template name.