Nodes/ComfyUI-Dart/Dart Decode
ComfyUI Node

Dart Decode

Dart Decode (DanbooruTagsTransformerDecode) — ComfyUI node guide

By nkchocoai·Created 2 years ago·Updated about a year ago· 33
Dart Decode
  • tokenizer
  • token_ids
  • STRING
skip_special_tokenstrue

Dart Decode does the last, boring-but-necessary step in the Dart pack's "advanced" pipeline: it turns a raw token sequence back into a readable Danbooru tag string. Nothing fancy, but if you've been generating with Dart Generate(Advanced) instead of the plain Dart Generate node, you need this - or something like it - before you have anything you can actually paste into a prompt.

Why the split even exists

The plain Dart Generate node decodes its output for you automatically, so most people never touch this node directly. But the pack also offers a raw-token pipeline through Dart Generate(Advanced), and that path exists specifically so you can operate on the token sequence before it becomes text - stripping tags with Dart Remove Tag Token, reordering with Dart Rearranged By Animagine, or splitting it into rating/character/copyright pieces with Dart Decode By Splited Parts. Once you're done editing the token sequence, something has to turn it back into a string, and that's this node's whole job.

Inputs and outputs

Three required inputs: tokenizer (DART_TOKENIZER, from Dart Load - the same tokenizer instance that produced the tokens in the first place, or decoding will be nonsense), token_ids (DART_TOKEN_IDS, from Dart Generate(Advanced) or one of the token-editing nodes downstream of it), and skip_special_tokens, a boolean that defaults to true.

That last one is the only real decision to make here. Dart's token sequences carry the same special tokens you see in the raw prompt format - things like <|bos|>, <rating>, <|input_end|> - which mark structure for the model but aren't tags you'd ever want in a prompt. Leave skip_special_tokens on true for a clean, ready-to-use tag string. Flip it off only if you're debugging the pipeline and want to see exactly what the model output, structural markers and all - that's a diagnostic use, not something you'd wire into a prompt.

The single STRING output is your finished tag list, the same shape you'd get straight out of the plain Dart Generate node - safe to wire directly into a CLIP Text Encode.

Installing it

Install through ComfyUI Manager (search "ComfyUI-Dart") or clone it by hand: cd ComfyUI/custom_nodes && git clone https://github.com/nkchocoai/ComfyUI-Dart.git, then restart ComfyUI. This node ships as part of the whole pack - there's nothing to install separately, and no extra model download; the tokenizer it needs was already pulled down when Dart Load first ran.

Where this actually goes wrong

Honestly, not much - it's a thin wrapper around a standard tokenizer decode call, so there isn't much room for it to misbehave on its own. The failures that show up here are really upstream problems surfacing late: if the token_ids you're feeding in came from a mismatched model/tokenizer pair (say, tokens generated against dart-v2-sft decoded with a tokenizer loaded for dart-v1-sft), you'll get scrambled or nonsensical text out, and it'll look like this node is broken when the real issue is a Dart Load upstream that doesn't match what generated the tokens. Keep one Dart Load node feeding both the generation side and the decode side of your graph, and that class of problem doesn't come up.

If you don't need to touch the token sequence at all - no tag removal, no reordering - skip this whole raw-token detour and just use the plain Dart Generate node, which decodes internally and saves you wiring this one in by hand.

CategoryDart

Inputs (3)

NameTypeDefaultDescription
tokenizerDART_TOKENIZER
token_idsDART_TOKEN_IDS
skip_special_tokensBOOLEANtrue

Outputs (1)

NameTypeDescription
STRINGSTRING