Extensions/ComfyUI-Generator-Pack
ComfyUI Extension

ComfyUI-Generator-Pack

Danbooru-based tags generator pack. - Tags Generator, Tags Extractor, Character Tags Generator, Tags Conflict Filter, Classify Tags, Weight Tags - a/Workflow

By alchemine·Created about a month ago·Updated a day ago· 8
alchemine/comfyui-generator-pack
Nodes7
On cloudLocal install
CategoryGeneratorPack/Tags
Stars8
Updateda day ago
Readme

ComfyUI-Generator-Pack

English | 한국어

Suggests the tags most relevant to your prompt from a Danbooru dataset, and drops the ones that contradict it. It also turns a sentence into tags, draws Danbooru character tags, splits a prompt by category, and weights the categories you pick.

Example

Image

Workflow

The example workflow chains five nodes. Tags Extractor turns a sentence into tags, Character Tags Generator draws characters to join them, Tags Generator grows the result into a full prompt, Classify Tags splits it by category, and Weight Tags weights the categories switched on.

Usage

Tags Generator

Feed a prompt into Tags Generator, read the extended prompt out of text, or the added tags alone out of generated_text.

| Widget | What it does | |--------|--------------| | n | How many tags to add, counted after post-processing. 0 = draw the length from the corpus and stop once nothing beats chance | | auto | Draws from the categories switched on below with no share. The shares below are ignored but kept | | subject / pose / expressions / body / clothes / background / bg_details / framing | A toggle and a _share each. body also covers hair and eyes, pose covers sex acts, background is the place alone, and bg_details covers props, light and effects. The share is relative to the categories still on: with only pose 0.2 and expressions 0.1, ten tags come back 7 and 3. -1 = no cap, 0 = off |

| Reach for | When | |-----------|------| | rating | The explicitness is off. all draws a tier from the seed, so a new seed rerolls it | | momentum | The tags have nothing to do with each other (raise), or read as one runaway scene (lower) | | repetition_penalty | Half the draw goes on respelling one idea: blue skin, pale skin, dark skin | | lift_threshold | The output contradicts the prompt in ways the data merely discourages. The default 0.5 blocks pairs seen together under half as often as chance, which includes pairs never seen together. Once the prompt has two or more characters (2girls, hug, yuri), pairs are judged on all posts instead of solo ones | | blacklist | A regex over the candidates (hair\|eyes, ^black ). <color> expands from resources/wildcards.yaml. Filters candidates, so n still holds | | temperature / top_k / top_p / min_p / seed | The usual sampling knobs. temperature 0 is argmax | | filter_copyright | On by default: drops candidates owned by one character or franchise: the tags that turn a library into Patchouli's library. resources/copyright_blacklist.txt adds the ones the statistics miss, and is meant to be edited. Your own tags are never dropped | | order_tags | On by default: the added tags come back grouped by kind: subject, body, expressions, pose, clothes, props, place, framing. Off keeps the draw order. The input prompt is never reordered |

Every widget carries its own tooltip; hover it with the node in front of you.

Three things happen without a widget:

  • An empty prompt draws an anchor (beach, moon) and grows a scene from it.
  • A weight at or below zero pushes a tag away: (light particles:-1.2).
  • A one-person prompt blocks tags that need a second character. The list is resources/solo_conflict.txt, editable after the first run.

Character Tags Generator

Draws Danbooru character tags from the characters with at least 100 posts, all equally likely.

| Widget | What it does | |--------|--------------| | n | How many characters to draw | | sex | Which of girl, boy, other to draw from, at least one. A character's sex is whichever of 1girl, 1boy, 1other sits on most of its solo posts, other on a tie. Characters tagged no humans at twice the average rate or more (pokemon, mecha) are other too | | subject | Puts the person count in front: 1girl, solo for one girl, 1girl, 1boy for a girl and a boy | | year_min / year_max | A toggle and a year each, limiting the year of the character's first post | | min_count | Only characters with at least this many posts |

Tags Extractor

Turns a sentence into the real Danbooru tags it names. A phrase the vocabulary cannot spell is looked up in the Danbooru wiki.

| Widget | What it does | |--------|--------------| | subject | Counts the people into person tags: a girl and two boys is 1girl, 2boys | | translate | Runs the text through Google Translate into English first (googletrans, one request per run) | | min_count | Drops tags with fewer posts than this | | blacklist | A regex for tags to drop from the result | | table (output) | Every match with the spelling it came in through and its post count |

Installation

Search for ComfyUI-Generator-Pack in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/alchemine/comfyui-generator-pack

Nodes (GeneratorPack/Tags)

Tags Conflict Filter: drops tags contradicting the fixed ones, by co-occurrence lift rather than a hand-written conflict list. Tags Generator's veto as a node of its own, for tags from anywhere else.

Classify Tags: splits a prompt into Tags Generator's eight categories, grouped the same way, plus character for Danbooru character tags and others for what no category draws.

Group Tags: one themed group per line; tags sharing a last (or first) word gather together, person tags lead. cap trims each group, colours first.

Weight Tags: wraps the tags of the categories switched on in (tag:weight), a toggle and a weight for each of Classify Tags' outputs (Tags Generator's eight, character and others). expressions 1.5 and background 1.2 turn :3, shirt, library into (:3:1.5), shirt, (library:1.2). Other tags pass through. mode says what a weight a tag already has becomes: replace swaps it, keeping its sign, and multiply multiplies.

Data

translate is the one thing that leaves the machine: it sends the text to Google Translate through googletrans. Everything else runs offline.

The character list is built from danbooru-2026-clean-metadata, which runs to 2025-09.

Nothing ships in the repository. Every table, label file and list downloads into resources/ the first time a node needs it, each pinned by sha256: the small files as one archive, the statistics tables (up to 100MB) separately, so a workflow that only groups tags never pulls what the sampler needs. A file already on disk is never re-fetched, so an edited solo_conflict.txt, copyright_blacklist.txt or wildcards.yaml stays yours.

License

GPL-3.0. See LICENSE.