Nodes/ComfyUI-Dart/Dart Rearranged By Animagine
ComfyUI Node

Dart Rearranged By Animagine

Dart Rearranged By Animagine (DanbooruTagsTransformerRearrangedByAnimagine) — ComfyUI node guide

By nkchocoai·Created 2 years ago·Updated about a year ago· 33
Dart Rearranged By Animagine
  • tokenizer
  • token_ids
  • DART_TOKEN_IDS

Dart Rearranged By Animagine takes a Dart-generated tag sequence and reorders it to match Animagine XL's documented prompt structure - same tags, different order. It sounds cosmetic until you remember how these models actually read a prompt: on Danbooru-tag models, earlier tags get more attention weight than later ones, so where a tag sits in the list isn't neutral. This node exists because tag order is a real lever, not just tidiness.

Why order gets its own dedicated node

If you've used the regular Dart Generate node, you've already used this logic without realizing it - it has an animagine_order boolean, on by default, that does exactly this reordering automatically as part of decoding. This node is that same behavior pulled out and exposed on its own, for the token-level pipeline: once you're generating with Dart Generate(Advanced) and working with raw DART_TOKEN_IDS instead of a finished string, the automatic version isn't available to you anymore, so this is how you get the same reordering back as an explicit step you control.

What it actually takes

Two required inputs, both familiar from the rest of the pack: tokenizer (DART_TOKENIZER, from Dart Load) and token_ids (DART_TOKEN_IDS, which has to come from Dart Generate(Advanced) or another token-editing node - not from the plain Generate node, which only outputs a decoded string). The single output is DART_TOKEN_IDS - still raw tokens, reordered but not yet decoded. You still need Dart Decode or Dart Decode By Splited Parts downstream to turn it into text you can actually use.

There's no separate configuration here - no field to tweak the target order - because it's applying one specific, fixed convention: the tag ordering Animagine XL's own prompt guide documents. If you want a different order than that, this isn't the node for it; you'd be looking at manual tag reordering after decode instead.

Installing it

Install via ComfyUI Manager (search "ComfyUI-Dart") or clone manually: cd ComfyUI/custom_nodes && git clone https://github.com/nkchocoai/ComfyUI-Dart.git, then restart ComfyUI. It's part of the same pack as everything else here - no separate install, and no model download; it's a pure reordering step over tokens you already generated.

Where this actually matters

If you're already using the plain Dart Generate node with animagine_order left on its default true, you're already getting this behavior for free - you don't need this node at all. It only becomes relevant once you're on the raw-token path via Dart Generate(Advanced), typically because you also want to strip tags with Dart Remove Tag Token or split the output with Dart Decode By Splited Parts. In that case, where you place this node relative to the others matters: reordering before you split into rating/copyright/character/people/other-general pieces is redundant, since the split output no longer has one combined ordering to preserve. Put this step where you're building a single combined tag string, not where you've already broken it apart.

One thing worth being honest about: this node applies Animagine's specific documented order, and whether that's the right order for whatever checkpoint you're actually generating with is a separate question - it's a well-tested default for Danbooru-tag models generally, not a guarantee that it's optimal for every merge or fine-tune you might be prompting.

CategoryDart

Inputs (2)

NameTypeDefaultDescription
tokenizerDART_TOKENIZER
token_idsDART_TOKEN_IDS

Outputs (1)

NameTypeDescription
DART_TOKEN_IDSDART_TOKEN_IDS