ComfyUI Node

Danbooru Tags Upsampler

The node that's secretly just DanbooruTagsUpsampler

By rookiestar28·Created about a year ago·Updated 23 days ago· 16
Danbooru Tags Upsampler
    • upsampled_prompt
    prompt1girl, solo
    model_namedart-v1-sft
    tag_lengthlong
    seed0
    temperature1.00
    top_k30
    top_p1.00
    num_beams1
    model_devicecpu
    model_backendONNX (Quantized)
    max_new_tokens128
    negative_prompt_tags
    ban_tags
    cfg_scale1.5
    debug_loggingfalse

    If you searched for this because you saw two "Danbooru Tags Upsampler" nodes in your menu, good instincts - that's the whole story. DanbooruTagsUpsamplerNodeRay is a legacy alias. Both registry keys point at the exact same Python class, expose the identical inputs and outputs, and land in the same Prompt Styling/casual_gamer28 category. The pack's README calls this key a "legacy compatibility key" kept so older saved workflows still load. Nothing about it is different, slower, or newer.

    So everything that's true of the canonical node is true here: it's a ComfyUI port of p1atdev's sd-danbooru-tags-upsampler for A1111, and it uses DART, a small LLM trained on Danbooru tags, to complete a sparse prompt like 1girl, solo into a full tag list. No API, no key, no account - it runs the model locally and hands you a plain string.

    How it works, briefly

    Your prompt gets classified against the bundled tag lists (character.txt, copyright.txt, quality.txt), then the DART model receives a special length token - <|long|> and friends - plus your tags, and generates a completion. The node returns your original prompt joined with the generated tags as upsampled_prompt, which you feed into CLIPTextEncode and on to the KSampler. Wire it into an Illustrious/NoobAI/Pony workflow where the model actually speaks Danbooru tags, and you'll get coherent detail instead of the contradictory nonsense a random tag generator would produce.

    The settings that matter are the same list: prompt, tag_length (long is a fine starting point), ban_tags to exclude specific tags or wildcards, and model_backend - default ONNX (Quantized) is the fastest and smallest, while Original is the only backend where negative_prompt_tags + cfg_scale CFG actually works. ONNX rejects CFG. dart-v2-moe-sft is Original-only, and dart-v2-sft ships quantized ONNX only.

    Installing it

    Same pack, same steps. ComfyUI Manager (search "Danbooru Tags Upsampler") or:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/rookiestar28/ComfyUI-Danbooru-Tags-Upsampler.git
    cd ComfyUI-Danbooru-Tags-Upsampler
    python install.py
    

    Dependencies are transformers, optimum[onnxruntime], tokenizers, sentencepiece - torch comes from ComfyUI itself and is intentionally not pinned. Restart, and the DART models download automatically from Hugging Face on first run, so the first generation will hang longer than usual while it fetches them.

    The only question that matters here

    Which one should you add to a new workflow? Use the canonical DanbooruTagsUpsampler - it's the one the maintainer lists first and the one the pack's documentation, search aliases, and tooltips are built around. If a saved workflow references the NodeRay key it will still load and run identically, so there's no migration emergency. Seeing two identical-looking nodes in your menu isn't a sign something's broken - it's just this pack shipping one node under two names.

    CategoryPrompt Styling/casual_gamer28

    Inputs (15)

    NameTypeDefaultDescription
    promptSTRING1girl, soloComma-separated Danbooru tags to analyze and expand.
    model_nameCOMBOdart-v1-sftAllowlisted DART model. Model files use a pinned revision and may download on first use.
    tag_lengthCOMBOlongTarget amount of detail requested from the DART model.
    seedINT00–4294967295Generation seed. Reproducibility can still vary across backends, devices, and library versions.
    temperatureFLOAT1.000.01–5Sampling randomness; higher values produce more varied tag choices.
    top_kINT300–1000Limits sampling to the highest-probability tokens; 0 disables this limit.
    top_pFLOAT1.000–1Nucleus-sampling probability mass; 1.0 keeps the full distribution.
    num_beamsINT11–20Beam-search width. Larger values use more time and memory.
    model_deviceCOMBOcpuRequested execution device. Failed CUDA initialization falls back to CPU and is logged.
    model_backendCOMBOONNX (Quantized)Original supports CFG. ONNX variants enforce ban tags but reject CFG; unavailable artifacts fall back with a warning.
    max_new_tokensINT1288–512Maximum number of new tokens generated for the tag completion.
    negative_prompt_tagsoptSTRINGTags used for CFG with the Original backend. ONNX rejects CFG requests.
    ban_tagsoptSTRINGComma-separated tags or supported wildcard patterns to block on every backend.
    cfg_scaleoptFLOAT1.51–10Classifier-free guidance strength for negative tags; supported only by Original.
    debug_loggingoptBOOLEANfalseEnable detailed node/runtime logs for troubleshooting.

    Outputs (1)

    NameTypeDescription
    upsampled_promptSTRINGThe original prompt plus generated Danbooru tag completions.