Danbot Generation Config
The sampler settings for a text model, not an image model
- generation_config
If you've ever tuned a KSampler, you already know what Danbot Generation Config does - just for a language model instead of an image one. The Danbot transformer that turns your sentence into Danbooru tags samples from a probability distribution over tokens, and this node is the dial panel for that sampling. Temperature, top_p, top_k, all the usual suspects, plus a couple of LLM-specific ones.
It's an optional node in most workflows, and that's the first thing to know: leave it out and the generator falls back to greedy decoding, which picks the single most likely token every step. That's deterministic, fast, and often fine - it'll give you the safe, boring tag list. You reach for this node when greedy output feels stiff, repetitive, or just wrong, and you want the model to actually think.
The settings that matter
temperature(default 1.0) - the big one. Lower = more deterministic, higher = more creative/random. The tooltip's guidance is worth taking seriously: keep it under 1.5, or the tag output starts degenerating into token soup.top_p(default 1.0) - nucleus sampling: only sample from the smallest token set whose cumulative probability passes the threshold. 1.0 means "ignore this, use everything."top_k(default 50) - sample from only the top 50 most likely tokens. The author suggests staying in the 10–200 range. Together with top_p, these are your diversity brakes.min_p(default 0.0) - a newer knob: drop any token with probability below this. The author's tip here is genuinely useful - set it to ~0.1–0.2 and you can safely push temperature and top_k higher without the output falling apart. It's a gentler filter than top_k.max_new_tokens(default 256, max 512) - hard cap on how many tokens the model generates. If tag lists are getting cut off, bump this.num_beams(default 1) - beam search. 1 = off. The tooltip's the honest take: it's mostly useful as a rescue when temperature is too high and you want coherent-but-random output.do_sample- literally a "true/false" toggle for sampling vs greedy. Leave it ontrueif you plugged this node in at all.
The output is a generation_config handle, not a string, and it feeds the Danbot Generator or Danbot V2408 Pipeline. You only need one per workflow - build it once, share it to both nodes.
Install
Same story as the rest of the pack. 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.) The pack's real dependencies are transformers, sentencepiece, protobuf; restart ComfyUI afterward and it'll be in the prompt/Danbooru Tags Translator menu.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| max_new_tokens | INT | 2561–512 | Maximum number of tokens to generate |
| do_sample | COMBO | true | Whether to use sampling or greedy decoding |
| temperature | FLOAT | 1.000.1–5 | Temperature for sampling. Lower values are more deterministic, higher values more random. Default value is 1.0. Recommended to be less than 1.5. |
| top_p | FLOAT | 1.00.1–1 | Tokens are sampled from the smallest set whose cumulative probability exceeds the probability p. Default value is 1.0. |
| top_k | INT | 5010–1000 | Tokens are sampled from the top k most likely tokens. Larger values mean more diversity and randomness. Default value is 50. Recommended to be between 10 and 200. |
| min_p | FLOAT | 0.000–1 | Minimum probability to select tokens from. Tokens with probability less than this value are going to be ignored. Default value is 0.00. If you set this value to around 0.1 ~ 0.2, you can set higher temperature and top_k values. |
| num_beams | INT | 11–10 | Number of beams to use for beam search. 1 means no beam search. It is effective when the temperature is too high. Default value is 1. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| generation_config | DANBOT_GENERATION_CONFIG | Generation config for the upsampler node. |